Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!uunet!mcsun!sunic!tut!tukki!tarvaine From: tarvaine@tukki.jyu.fi (Tapani Tarvainen) Newsgroups: comp.unix.wizards Subject: Re: vi and sed questions Message-ID: <1310@tukki.jyu.fi> Date: 17 Sep 89 18:39:07 GMT References: <4370002@hpavla.HP.COM> Reply-To: tarvaine@tukki.jyu.fi (Tapani Tarvainen) Organization: University of Jyvaskyla, Finland Lines: 29 In article <4370002@hpavla.HP.COM> rowland@hpavla.HP.COM (Fred Rowland) writes: >Two questions about editing; one about vi and one about sed! [vi question deleted] > The file used in the above example is a mail list which >has to be converted into labels. I add three @ symbols to the end >of each line, then convert all of them to newlines. I can do this >in vi but I get substitution overflows as the file grows considerably >in size. I would prefer to use sed, but how do you tell sed to >split a line (generate a newline)? I've tried various >combinations of \(Return), \n, CTRL-V, and such but nothing >works. I EVEN READ THE MANUAL! It told me to use \n and >gave an example. It didn't work. This has to be possible, but >how? Strange. The following 2-line sed script does it just fine for me: s/@/\ /g (Nothing invisible in there, just what it looks like.) Just tried it on four machines (SunOS 4.0, HP-UX 6.5, BSD4.3 in a VAX and GNUSED in MS-DOS) and it worked just as I expected in them all. The only problem with this I can think of is that if you're using csh or tcsh you have to put the script in a file and use the -f option. What machine, OS and shell are you using? -- Tapani Tarvainen (tarvaine@tukki.jyu.fi, tarvainen@finjyu.bitnet)