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

decimating a HUGE file 1

Status
Not open for further replies.

isileth

Technical User
Jul 18, 2001
9
US
Guys -
Got a massive 5 column file - I need to basically create a new file with every nth line from the original. I'm fairly new to awk and have left all my course notes and reference manuals at home!
Any help would be appreciated

Cheers.
 
Not sure what you mean, but for example if you wanted every 3rd line from the file, then you could do

awk 'NR % 3 == 0 {print}' myfile > newfile

If you need something else then post back.

Greg.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top