Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
sed '15~15d' /input/file > /output/file
[gray]# or[/gray]
awk 'NR%15' /input/file > /output/file
[gray]# or with GNU sed[/gray]
sed -i '15~15d' /input/file
The following address types are supported:
[COLOR=blue]number[/color] Match only the specified line [COLOR=blue]number[/color].
[COLOR=blue]first[/color]~[COLOR=blue]step[/color]
Match every [COLOR=blue]step[/color]'th line starting with line [COLOR=blue]first[/color]. For example, ``sed -n
1~2p'' will print all the odd-numbered lines in the input stream, and the
address 2~5 will match every fifth line, starting with the second. (This is
an extension.)
After my memory seems my precognition also gave up. I was sure you will suggestPHV said:Try nawk instead of awk.
awk 'NR%15[red]{print}[/red]' /path/to/input > output
# delete every 8th line
gsed '0~8d' # GNU sed only
sed 'n;n;n;n;n;n;n;d;' # other seds