[dev] ssam rocks! unwrapping paragraphs

2022-03-22 Thread Greg Reagle
Hello. I downloaded a text file from Project Gutenberg and the paragraphs were hard wrapped, aka filled in Emacs jargon. I want the lines to wrap to whatever window width I am using of course, so I want them to be un-wrapped in the text file. I tried all sorts of sed/awk/grep/perl ways to unw

[dev] ssam rocks! unwrapping paragraphs

2022-03-22 Thread 201009-suckless
sed is the canonical paragraph mangler. It's worth spending a bit to grok how that is true. tr -d '\r' | sed '/^$/!{H;d;};p;x;s/\n/ /g;' Gutenberg lines are CRLF-terminated so `tr` is needed.

Re: [dev] ssam rocks! unwrapping paragraphs

2022-03-22 Thread Greg Reagle
On Tue, Mar 22, 2022, at 9:49 PM, 201009-suckl...@planhack.com wrote: > sed is the canonical paragraph mangler. It's worth spending a bit to > grok how that is true. > > tr -d '\r' | sed '/^$/!{H;d;};p;x;s/\n/ /g;' > > Gutenberg lines are CRLF-terminated so `tr` is needed. Right I forgot to m