Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2011
    Posts
    1

    Unanswered: script for extracting some lines from a text file

    I have a text file which has thousands of lines I need to extract some lines based on some key words present in the line. Like this

    120611 aaaaabbbbbccccccc
    120611 cccccdddddeeeeeee
    120711 ddddeeeefffffffffffff

    now I need to extract those lines which contains the keyword 'de' and save it to a new file

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Code:
    gawk "/de/" de
    Works for a file named de.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  3. #3
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Whatever happened to good old grep?

Posting Permissions

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