On 2021-12-08, Adam Carter wrote:
>
> I want to replace any newlines between 'comment "' and the next '"' with
> spaces so the whole comment is on a single line. How can it be done?
Hmm, maybe:
$ awk '/^comment "[^"]*$/ { ORS=" " } /"$/ { ORS="\n" } { print }' yourfile.txt
That means if a line starts with 'comment "' but doesn't end with ",
change the ORS (output record seperator) to a space. If it does end with
a ", change it to a newline.
Tavis.
--
_o) $ lynx lock.cmpxchg8b.com
/\\ _o) _o) $ finger [email protected]
_\_V _( ) _( ) @taviso