I am rather late to this party but assuming your records are all seperated by a single blank line and there are no superfluous blank lines then this rather obfu looking one liner will get you there
perl -pe'BEGIN{print"__BEGIN__\n"}s/^\s*$/__BEGIN__\n__END__\n/;END{pr +int"__END__\n"}' <file>
Or the mildly shorter but fiercly uglier
perl -pe'$e="__END__\n";BEGIN{$b="__BEGIN__\n";print$b}s/^\s*$/$b$e/;E +ND{print$e}' <file>
Cheers,
R.
In reply to Re: parsing a file
by Random_Walk
in thread parsing a file
by tcf03
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |