Hi,
I am trying with the below command to extract every line after 3 lines in a file.
Somehow I am failing to achieve it. Why?
awk '!($1%3)'
Hi,
I am trying with the below command to extract every line after 3 lines in a file.
Somehow I am failing to achieve it. Why?
awk '!($1%3)'
Like this?
$> cat infile
1
2
3
4
5
6
7
$> awk 'NR % 3 == 0' infile
3
6
awk '!(NR%4)' infile
---------- Post updated at 06:50 AM ---------- Previous update was at 06:49 AM ----------
Use gawk, nawk or /usr/xpg4/bin/awk on Solaris.
Do you mean like this:
awk 'NR>3' infile
That could be the 4th line, the 8th line and so fort. Please clarify your question.