For Programmers: Free Programming Magazines  


Home > Archive > AWK > May 2005 > Re: Simple query how do I print a space after every second line









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Simple query how do I print a space after every second line
Ed Morton

2005-05-03, 8:55 pm



Loki Harfagr wrote:

> Le Tue, 03 May 2005 03:41:50 +0000, sammy a écrit :
>
>
>
>
> Have a try starting whith this :
> awk '{print};(NR%2==0) {print ""}'


Or, abbreviated:

awk '1;NR%2==0{print ""}'

Regards,

Ed.
Kenny McCormack

2005-05-03, 8:55 pm

In article <d58ig1$kot@netnews.proxy.lucent.com>,
Ed Morton <morton@lsupcaemnt.com> wrote:
....
>
>Or, abbreviated:
>
>awk '1;NR%2==0{print ""}'


ORS=NR%2?"\n":"\n\n"
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com