Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2010
    Posts
    72

    Unanswered: Separation of lines from file

    Hi

    I have a file with content as follows

    ha106sr1 autosysdb1 0 trunc log on chkpt
    ac1101qa1 IHSTORY 0 trunc log on chkpt
    ab1101rs1 REPORT 0 trunc log on chkpt
    ea1143rs2 cfdm01db 40 trunc log on chkpt
    xye1143abr2 cfw001db 40 trunc log on chkpt
    bc1143de2 digtempdb 56 trunc log on chkpt

    I have to separate the lines which are non zero in the 3rd column of the file to a diff file

    Thanks

  2. #2
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Code:
    awk '{ if ( $3 != 0 ) { print $0; } }' < input-file > result-file
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •