bug-gawk
[Top][All Lists]
Advanced

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

Re: report a bug of the function of patsplit


From: Wolfgang Laun
Subject: Re: report a bug of the function of patsplit
Date: Tue, 18 Aug 2020 17:18:46 +0200

patsplit(string, array [, fieldpat[, seps]])
The pattern *fieldpat *matches *fields, *and they'll be stored in *array. *The
function works as described.

-W

On Tue, 18 Aug 2020 at 15:38, 天骄之鹰 <tianjiaozhiying@qq.com> wrote:

> Hi, guys:
>
>
> &nbsp; &nbsp; I find that the function of patsplit has a bug.
>
>
> &nbsp; &nbsp; patsplit(string, array [, fieldpat[, seps]]) : To save
> pieces into 'array', store separator into 'seps'. But this function saves
> pieces into 'seps', not strore into 'array'
>
>
>
>
>
>
> // souce codes
> [root@novice commands]# echo "chinaos cnaps mmnasten" | gawk '{
> patsplit($0, arr,"na", sepp )} END{ for( x in arr){ print "arr[" x "]="
> arr[x]}; for( y in sepp){ print "sepp[" y "]=", sepp[y]}}'
> arr[1]=na
> arr[2]=na
> arr[3]=na
> sepp[0]= chi
> sepp[1]= os c
> sepp[2]= ps mm
> sepp[3]= sten
>
>
>
> [root@novice commands]# echo "chinaos cnaps mmnasten" | gawk '{
> patsplit($0, arr,"na", sepp )} END{ for( x in arr){ print "arr[" x "]="
> arr[x]}; for( y in sepp){ print "sepp[" y "]=", sepp[y]}}'
> arr[1]=na
> arr[2]=na
> arr[3]=na
> sepp[0]= chi
> sepp[1]= os c
> sepp[2]= ps mm
> sepp[3]= sten
>
>
>
>
>
> &nbsp; &nbsp; Good luck.&nbsp;
>
> 天才就是毅力!
>
>
> &nbsp;


reply via email to

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