home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!fuug!demos!kiae!glas!demos!news.eng.c!convex.COM!tchrist
- From: tchrist@convex.COM
- Newsgroups: comp.unix.questions
- Date: 17 Jul 92 23:10 MDT
- Subject: Re: Collapsing continuation lines (
- Sender: Notesfile to Usenet Gateway <notes@glas.apc.org>
- Message-ID: <1992Jul17.191046.1672@news.eng.c>
- Nf-ID: #N:1992Jul17.191046.1672@news.eng.c:329777310:001:979
- Nf-From: convex.COM!tchrist Jul 17 23:10:00 1992
- Lines: 32
-
-
- From the keyboard of davidf@mks.com (David J. Fiander):
- : sed -e '/\|/,/^$/ {
- : /\|/{h;d;}
- : /^./{H;d;}
- : /^$/ {
- : x
- : s/[ \t]*\n[ \t]*/ /g
- : p
- : x
- : }
- : }' inputfile
- :
- :Pretty scary eh? No, I didn't come up with this off the top of
- :my head, this is a modification of a script which compresses
- :RFC-822 continuation lines which I wrote for another purpose.
-
- This, BTW, is my major beef with sed. It's generally pretty fast at what
- it does, but has nothing like reasonable variables or reasonable flow
- control. You can do a lot in it, but I'm not sure that it really does
- beat a boot to the head. If someone gives me a working sed script of some
- complexity, I'm glad to use it, but I sure would rather develop new
- scripts in something further removed from the text-processing equivalent
- of machine language.
-
- --tom
- --
- Tom Christiansen tchrist@convex.com convex!tchrist
-
- "I never met a chocolate I didn't like."
- --Deanna Troy, ST:TNG
-
-