| Newsgroups |
gmane.editors.sed.user |
| Message-ID |
<[email protected]> |
* Jim Hill <[email protected]> [2016-01-22 16:20]:
> On windows atm, gmail's my option, sorry for formatting,
>
> #/usr/bin/sed -Ef
> /^> / { N;
> /.{70,}/ s/((> )*)([^>\n][^\n]*)\n\1([^> ].{,})$/\1\3 \4/
> P;D;
> }
>
> works on your sample,
indeed, it does! :) thank you very much!
http://www.guckes.net/examples/gg.tw72.comb.txt
my sed does not have the option "-E",
so i had to add change it a bit:
"(> )*" --> "[> ]*"
"{...}" --> "\{...\}"
and the "\4" has to be "\2" ;)
adding a semicolon allows to put it all into one line:
# 2016-01-22 by Jim Hill <[email protected]>
/^> / { N; /.\{70,\}/s/\([> ]*\)\([^>\n][^\n]*\)\n\1\([^> ].\{,\}\)$/\1\3 \2/ ; P;D; }
now your solution and Rakesh's one are in my display_filter!
> which doesn't seem to have actually been wrapped as the
> `tw72` in its name implies because some of the apparently
> desired output lines are less than that after joining.
> The constraints are arbitrary anyway, play with the {,}s to
> taste, I think the N;munch;P;D usage is the payload here.
will do. thanks again! :)
Sven [rewriting his display_filter]