RE: [ILUG] sed people ?

From: Kenn Humborg (kenn at domain bluetree.ie)
Date: Fri 11 Feb 2000 - 12:59:39 GMT


> This is annoying me. I have a file with '|' delimiters. I want to get rid
> of any spaces after them. Say it looks like
>
> foo | bar | bing | something else | baz
>
> I want it to look like:
>
> foo|bar|bing|something else|baz
>
> Now, I tryed to run:
>
> cat file | sed -e 's/| */|/' > file1
> cat file1 | sed -e 's/ *|/|/' > file
>
> That regexp works fine in Vim. Not in sed. Mutter.

You forgot the g at the end of the command:

$ cat file | sed -e 's/| */|/g' > file1
$ cat file1 | sed -e 's/ *|/|/g' > file

This works for me...

Later,
Kenn



This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:05:24 GMT