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