Re: How to find certain newlines and delete them in ksh.
From: Charles Demas (demas_at_TheWorld.com)
Date: 10/02/03
- Next message: Barry Margolin: "Re: sort + head = weirdness?"
- Previous message: Charles Demas: "Re: more search ean replace with sed"
- In reply to: Terry Carpenter: "How to find certain newlines and delete them in ksh."
- Next in thread: Terry Carpenter: "Re: How to find certain newlines and delete them in ksh."
- Reply: Terry Carpenter: "Re: How to find certain newlines and delete them in ksh."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 1 Oct 2003 22:56:55 +0000 (UTC)
In article <dd6bca79.0310011443.14c58cd3@posting.google.com>,
Terry Carpenter <groupuser@comcast.net> wrote:
>Hello!,
> I have a text file where I need to delete all '\n' that are not
>immediately preceded by a '|' (pipe) character. I have tried "tr
>'\012' '' < FILE" but this removes all the '\n'.
awk '/[|]$/ {print; next}{printf("%s",$0)}' infile
Chuck Demas
-- Eat Healthy | _ _ | Nothing would be done at all, Stay Fit | @ @ | If a man waited to do it so well, Die Anyway | v | That no one could find fault with it. demas@theworld.com | \___/ | http://world.std.com/~cpd
- Next message: Barry Margolin: "Re: sort + head = weirdness?"
- Previous message: Charles Demas: "Re: more search ean replace with sed"
- In reply to: Terry Carpenter: "How to find certain newlines and delete them in ksh."
- Next in thread: Terry Carpenter: "Re: How to find certain newlines and delete them in ksh."
- Reply: Terry Carpenter: "Re: How to find certain newlines and delete them in ksh."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]