Wednesday, 21 August 2013

AWK to print nth line from a file

AWK to print nth line from a file

i want to print every Nth line of a file using AWK. i tried modifying the
general format :-
awk '0 == NR % 4' results.txt
to:-
awk '0 == NR % $ct' results.txt
where 'ct' is the number of lines that should be skipped. its not working
. can anyone please help me out? Thanks in advance.

No comments:

Post a Comment