Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!convex!usenet From: tchrist@convex.COM (Tom Christiansen) Newsgroups: comp.unix.questions Subject: Re: Convert newlines to something else. Message-ID: <1991Feb07.171942.25184@convex.com> Date: 7 Feb 91 17:19:42 GMT References: <6011@idunno.Princeton.EDU> Sender: usenet@convex.com (news access account) Reply-To: tchrist@convex.COM (Tom Christiansen) Distribution: usa Organization: CONVEX Software Development, Richardson, TX Lines: 22 Nntp-Posting-Host: pixel.convex.com From the keyboard of tvz@phoenix.Princeton.EDU (Timothy Van Zandt): :How does one convert newlines to something else in a text file? I cannot :figure out how to do it with sed, if it is possible at all. Dealing with \n's in sed is not as straightforward as you might wish. Maybe someone will post a sed solution. I would use the tr program if you want single char translations, like perhaps % tr '\012' '/' outfile If you want more complex changes, I would use perl, perhaps like this: % perl -pe 's/\n/foobar /' outfile --tom -- "Still waiting to read alt.fan.dan-bernstein using DBWM, Dan's own AI window manager, which argues with you for 10 weeks before resizing your window." ### And now for the question of the month: How do you spell relief? Answer: U=brnstnd@kramden.acf.nyu.edu; echo "/From: $U/h:j" >>~/News/KILL; expire -f $U