Showing posts with label print every nth line using awk. Show all posts
Showing posts with label print every nth line using awk. Show all posts

Tuesday, May 4, 2010

Print every 6th line of a file ..

The below awk command will print every 6th line of a file test.txt starting from line number one.

awk '{if(NR%6==1) print $0}' test.txt

(Note: Print every nth line using awk.)
 

Blogger news

Blogroll