[ILUG] replacing mult. newlines

Brian singer at redbrick.dcu.ie
Tue Oct 5 18:34:12 IST 1999


Hi.


On Tue, Oct 05, 1999 at 06:16:58PM +0100, Matthew Sammon wrote:
> 
> Hi,
> 
> Just a quick question:
> 
> How do I replace newlines with something else in multiple
> files, preferably using awk or sed?
> 
> I need to replace:
> FOO
> : BAR

singer at mother  $ cat >asdasdasdasd
one line
two line
three line
4
^D
singer at mother  $ cat asdasdasdasd | tr '\n' ' '
one line two line three line 4 singer at mother  $

tr is your friend :)

Brian.




More information about the ILUG mailing list