Re: [gentoo-user] Re: script help - removing newlines

2021-12-08 Thread Adam Carter
> > Hmm, maybe: > > $ awk '/^comment "[^"]*$/ { ORS=" " } /"$/ { ORS="\n" } { print }' > yourfile.txt > Yes that works (after piping the file thru tr -d '\r' first). Thanks!

[gentoo-user] Re: script help - removing newlines

2021-12-08 Thread Tavis Ormandy
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

Re: [gentoo-user] script help - removing newlines

2021-12-08 Thread Michael Orlitzky
On 2021-12-08 17:15:43, Adam Carter wrote: > > but sometimes there are newline characters in the comment field; > > property "something" > > comment "something > > something else > > a third thing" > > I want to replace any newlines between 'comment "' and the next '"' with > spaces so the wh