On Monday, February 10, 2014 3:33:11 PM UTC-6, Jonathan Hankins wrote:
> On Saturday, February 8, 2014 2:52:07 PM UTC-6, meduza wrote:
>
> > I think it should be the following:
>
> >
>
> >
>
> >
>
> > awk '{print} (NR % 99 == 0) {print ""}'
>
> >
>
> >
>
> >
>
> > the problem after the first insertion of empty line with NR % 100 == 0 the nest empty line will be on 201th row which is wrong.
>
> >
>
> >
>
> >
>
> > I had a similar problem for awk and your suggestions did not work properly so I played with it and got the right result (every %100th row of my input file has to be blank line).
>
>
>
> If what you want is for a blank line to be injected into the output stream at every hundredth line, then I don't think this does what you want.
>
>
>
> When counting from 1, the hundredth lines are 100, 201, 302, ...
This was a braindead statement on my part.
> Compare (left column is input line number from nl, right is the actual input from seq):
I think what you want is"
$ seq 1 1000 | awk '{print}NR%100==0{print ""}' | nl -ba
1 1
2 2
3 3
...
97 97
98 98
99 99
100 100
101
102 101
103 102
104 103
...
198 197
199 198
200 199
201 200
202
203 201
204 202
205 203
...
299 297
300 298
301 299
302 300
303
304 301
305 302
306 303
...