[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: sed replacing newline



On 14:42 31 May 2003, dbrett <dbrett tcn net> wrote:
| I have a file where all the text was put on one line.   I noticed where
| there should have been a new line there was a ")" just before.  I tried to
| use sed to add a newline.  I could not get it to work.
| 
| cat junk.txt | sed s/\)/\n/g
| 
| I tried quoting adding quotes.  Does anybody know if it is possible to do
| this with sed?
| 
| I managed to accomplish what I wanted with
| 
| cat junk.txt | sed s/\)/\+/g | tr \+ \n

sed 's/)/\
/g' junk.txt >notjunk.txt

-- 
Cameron Simpson <cs zip com au> DoD#743
http://www.cskk.ezoshosting.com/cs/

WHAT is your name?                           Captain Jean-Luc Picard
WHAT is your quest?                            I seek the Holy Grail
WHAT is the top velocity of a Bird of Prey?      Romulan or Klingon?
I....I don't know...AAAHHHH!!!!
        - Mike Gaines, meg5184 hertz njit edu




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]