removing end of line mark with sed
Dan Bernstein
brnstnd at kramden.acf.nyu.edu
Wed Aug 22 02:59:33 AEST 1990
In article <768 at studsys.mu.edu> jetzer at studsys.UUCP (Mike Jetzer) writes:
[ trimmed ]
> In article <1990Aug19.194911.16628 at fs-1.iastate.edu> spam at iastate.edu (Begley Michael L) writes:
> >How do I remove the end of line marker from a stream?
> tr \\012 " " < file
> If you want more than one space (as your example seems to show), you
> can run the output of tr through sed or awk or whatever.
This is a bad idea, as spaces in the original would also be expanded. Do
the sed/awk bit first.
I'm about to start coding str, a ``string translator,'' to do everything
tr can do but with more than one character as a unit. It's not as if
other tools don't do the job; but somehow the syntax never seems right.
---Dan
More information about the Comp.unix.questions
mailing list