RE: [ILUG] sed people ?

From: Stephen_Reilly at domain dell.com
Date: Fri 11 Feb 2000 - 19:58:34 GMT


sed 's/ *| */|/g' file | cat > file

surely ??

ahhh, late evenings by the pc, gather children, I'll through another window
on the fire
Steve

> ----------
> From: Kenn Humborg[SMTP:kenn at domain bluetree.ie]
> Sent: 11 February 2000 12:59
> To: ilug at domain linux.ie
> Subject: RE: [ILUG] sed people ?
>
> > 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
>
>
> --
> Irish Linux Users' Group: ilug at domain linux.ie
> http://www.linux.ie/mailman/listinfo/ilug for (un)subscription
> information.
> List maintainer: listmaster at domain linux.ie
>



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