Code:
perl -00 -nle'print unless/^a.*\n^a/im&&!/^A/m' filename
Edit: Just saw you want only the comments, so it depends, you may try something like this:
Code:
perl -00 -nle'/^[A#]/m and print' filename
But it will fail on an input like this:
Code:
#
a 4 234 gfg
a 4 566 erer
With AWK you can try something like this, but it will fail in too many situations:
Code:
awk '/[A#] */' ORS='\n\n' RS= filename
Last edited by radoulov; 10-12-2008 at 05:17 PM..
|