Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2003
    Location
    India
    Posts
    114

    Unanswered: Cutting specified Line

    I want to extarct specific limes from mine file.Like

    File:

    This is Line 1.
    This is Line 2.
    This is Line 3.
    This is Line 4.
    This is Line 5.

    I want to retrieve only line 2. Which option fo head,tail or cut should I use.

  2. #2
    Join Date
    Apr 2004
    Location
    Boston, MA
    Posts
    325
    sed '2q;d' myFile.txt
    vlad
    +-----------------------+
    | #include <disclaimer.h> |
    +-----------------------+

  3. #3
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Cool

    Also:

    sed -n '2p' myFile.txt

    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

Posting Permissions

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