Hello,
I am experimenting currently with gawk-3.1.3-2 trying to grasp the basic 
principles and I have encountered the following issue. I have a simple 
text file data.txt containing this data: "aaa\r\n\r\nbbb\r\n\r\nccc", 
i.e. there is no "\r" or "\n" or "\r\n" at the end of the file.

I wonder, what the following gawk-script should output:

BEGIN{
    RS="\n\n+";
    ORS="";OFS="";
}

{
    print "\"",$0,"\"\n";
}

I assume, that it should be:

"aaa"
"bbb"
"ccc"

shouldn't it? Nevertheless, what I get is:

"aaa"
"bbb"
"cc"

i.e. the last "c" is mysteriously trimmed. Letting RS="" solves this 
issue, nevertheless I would like to understand, why the RS="\n\n+" 
version doesn't work. By the way, BINMODE is set to 0, so I presume, 
that the "\r\n" sequence is converted internally to "\n". Any suggestions?

Thanks in advance,
Mira

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
GnuWin32-Users mailing list
GnuWin32-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnuwin32-users

Reply via email to