Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

----- Copy a line to another file

Status
Not open for further replies.

DaniDak

Technical User
Mar 13, 2002
44
0
0
US
Hi,

What I need to do is, I have a line number, I need to find that line in a file using that line number and copy the entire line to another file. (A Korn Shell example would be great)

Thanks
 
man awk
man sed
man tail; man head

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
to get the third line:
Code:
sed '3q;d' file.txt

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Or..
[tt] awk NR==3 file1 > file2[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top