vi and sed questions
tom reingold
tr at pcharming.ctt.bellcore.com
Mon Sep 11 10:22:16 AEST 1989
On the subject of "vi and sed questions", rowland at hpavla.HP.COM (Fred
Rowland) writes:
$ [vi question deleted. I'll let someone else offer something.]
$
$ sed question
$
$ 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?
One nice solution is to use tr instead. Yeah! I finally get to
promote "my" program -- tr was named after me. No, just kidding.
I think the command
tr @ '\012'
should suffice.
Tom Reingold |INTERNET: tr at bellcore.com
Bellcore |UUCP: bellcore!tr
444 Hoes La room 1H217 |PHONE: (201) 699-7058 [work],
Piscataway, NJ 08854-4182 | (201) 287-2345 [home]
More information about the Comp.unix.wizards
mailing list