Inserting Blank Line into File (sed/awk/?)

D'Arcy J.M. Cain darcy at druid.uucp
Mon Mar 18 05:46:15 AEST 1991


In article <1991Mar15.190607.5061 at convex.com> Tom Christiansen writes:
>From the keyboard of tkevans at oss670.UUCP (Tim Evans):
>:I would like to be able to insert blank lines at regular intervals
>    awk '{ print; if (!(NR % 3)) print "\n" }'

Nope.  Either leave out the newline in the print statement or use printf
instead of print.  The way you have it you get 2 lines instead of one.

-- 
D'Arcy J.M. Cain (darcy at druid)     |
D'Arcy Cain Consulting             |   There's no government
Toronto, Ontario, Canada           |   like no government!
+1 416 424 2871                    |



More information about the Comp.unix.questions mailing list