help-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: inconstancy with RS = "(\r?\n){2}"


From: Wolfgang Laun
Subject: Re: inconstancy with RS = "(\r?\n){2}"
Date: Sat, 24 Jul 2021 07:28:47 +0200

I'm not sure what you did to demonstrate that this setting does not work.
But this is the awk program I tried:
   BEGIN { RS="(\r?\n){2}" }
   NR % 2 == 1 { print NR " " $0; }
and this is how I ran it (using 5.1.0), program output shown with a green
background:
/tmp$ gawk -f doublers.awk
abc
def

ghi
jkl
1 abc
def

mno
pqr

stu
vwx
3 mno
pqr
/tmp$

HTH
-W

On Sat, 24 Jul 2021 at 04:39, Alex fxmbsw7 Ratchev <fxmbsw7@gmail.com>
wrote:

> i tried this in my httpd project, but it doesnt result anything
>
> gawk -v RS="(\r?\n){2}" 1
>
> two enters it doesnt catch also
>
> it when entered some data sometimes needs multiple control d s to proceed \
> end
>


-- 
Wolfgang Laun


reply via email to

[Prev in Thread] Current Thread [Next in Thread]