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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Line number print in awk 1

Status
Not open for further replies.

rawatds

Programmer
Jun 3, 2004
30
SG
Hi is there any method in awk from which i can print all
lines between two line numbers .
e.g i want to print all lines between line number 100 and
10000 in a file .
please assist

Regards
Rawat
 
Something like this ?
awk 'NR>=100 && NR<=10000' /path/to/input > output
And a sed way:
sed -n -e '100,10000p' /path/to/input > output

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top