@yoda, that would be problematic if there is any kind of whitespace other than the newlines. Even if you set FS to a newline, the RS= would compress multiple newlines and create multiple records.
As a work-around one could choose a character that will not occur in the text for example:
Note that there would need to be curly braces around $1=$1 otherwise it would not print in case of 0 or whitespace in $1
But this would leave a trailing pipe symbol after the last record, so that still would not work as desired...
Also there might be record length limitations..
Last edited by Scrutinizer; 04-03-2013 at 04:52 PM..
This User Gave Thanks to Scrutinizer For This Post: