Print lines after every n lines in a file
Input has these lines:
line 1
line 2
line 3
line 4
line 5
line 6
line 7
line 8
line 9
line 10
how to write a script that prints only every 4 lines, in the case of the example input above:
line 1
line 5
line 9
Solution for this is:
awk 'NR % 4 == 1'
.png)







I am a software programmer working in India. I usually like to blog in my free time.
0 comments: