I have a file format that has blank lines within the record, and uses $$$$ as a record end.
Thus \n$$$$\n is the end of the record, the the next character starts the next record.
I have made several attempts to parse this with awk,
RS = "\n$$$$\n" does not work
RS = /\n\$\$\$\$\n/ does not work
and several other options do not work.
Now the thing that makes this strange is that if I go into the file and do an edit
$$$$ -> ####, i.e. changing the 4 $ to 4 #, the following value for RS works perfectly:
RS="\n####\n"
It would appear that the fact that the $ is the end of match marker is getting in the way here, but it would seem that it should be escaped with the \$ and the character just looked at as $, but it is not.
In one sense I have solved the problem by editing the file first and then processing it, but I would like to know if anyone has an idea of what is going on and what RS value I should be using to get the desired result.
Thanks.
Gary
Thus \n$$$$\n is the end of the record, the the next character starts the next record.
I have made several attempts to parse this with awk,
RS = "\n$$$$\n" does not work
RS = /\n\$\$\$\$\n/ does not work
and several other options do not work.
Now the thing that makes this strange is that if I go into the file and do an edit
$$$$ -> ####, i.e. changing the 4 $ to 4 #, the following value for RS works perfectly:
RS="\n####\n"
It would appear that the fact that the $ is the end of match marker is getting in the way here, but it would seem that it should be escaped with the \$ and the character just looked at as $, but it is not.
In one sense I have solved the problem by editing the file first and then processing it, but I would like to know if anyone has an idea of what is going on and what RS value I should be using to get the desired result.
Thanks.
Gary