How can I use text-processing tools to insert a new line after every N lines?
Example for N=2:
INPUT:
sadf
asdf
yxcv
cxv
eqrt
asdf
OUTPUT:
sadf
asdf
yxcv
cxv
eqrt
asdf
text processing
How can I use text-processing tools to insert a new line after every N lines?
Example for N=2:
INPUT:
sadf
asdf
yxcv
cxv
eqrt
asdf
OUTPUT:
sadf
asdf
yxcv
cxv
eqrt
asdf
Best Answer
With
awk
:With
sed
(GNU
extension):With
bash
: