extract a specific line from file
|
Original Message
|
Name: Aristo
Date: July 29, 2003 at 22:03:41 Pacific
Subject: extract a specific line from file OS: Unix CPU/Ram: ?
|
Comment: hi, can anyone teach me how to extract a specific line from an input file? what utility should I use? btw, I'm using Bourne Shell.
Report Offensive Message For Removal
|
|
Response Number 1
|
Name: Don Arnett
Date: July 29, 2003 at 22:25:11 Pacific
|
Reply: (edit)It depends upon how you want to recognize the specific line. Do you want the fourth line from a file?? Do you want a line that contains a specific phrase?
Report Offensive Follow Up For Removal
|
|
Response Number 2
|
Name: Aristo
Date: July 29, 2003 at 22:29:47 Pacific
|
Reply: (edit)just a normal line, not by delimeter... for example, the 4th line of an input file.. thanks
Report Offensive Follow Up For Removal
|
|
Response Number 3
|
Name: f
Date: July 29, 2003 at 23:37:46 Pacific
|
Reply: (edit)How about combination of head and tile in a pipe? Say, you need 4th line: head -n 4 your_file | tail -n 1
Report Offensive Follow Up For Removal
|
|
Response Number 6
|
Name: HRCafe
Date: August 5, 2003 at 05:45:21 Pacific
|
Reply: (edit)How about extracting the last line of a file. For example, I'm ftp'ing a file from UNIX to an NT box and an extra line is being added to the end of the file on the NT box. All it is is a blank line. I'm guessing this is a tranmission issue but does anyone know how to correct it? Please let me know your thoughts... Thanks!!!
Report Offensive Follow Up For Removal
|
Use following form to reply to current message: