Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Apr 2003 22:19:53 +0300
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        adrian kok <adriankok2000@yahoo.com.hk>
Cc:        questions@freebsd.org
Subject:   Re: sed to remove pattern ','
Message-ID:  <20030410191953.GB11398@gothmog.gr>
In-Reply-To: <20030410163001.63667.qmail@web21201.mail.yahoo.com>
References:  <20030410163001.63667.qmail@web21201.mail.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2003-04-11 00:30, adrian kok <adriankok2000@yahoo.com.hk> wrote:
> hi all
>
> I have problem to replace the pattern ',' to |
> can you give me hint?

Use double quotes.

> data:          'peter','30 Woodroad, CA','USA'
>                  'coral','110 Foreest','UK'
>
> to
>  'peter|30 Woodroad, CA|USA'
>  'coral|110 Foreest|UK'
>
> and I used the following but failed
>
> sed -e 's/\','/\|/g

Quoting is something that depends on the shell you're writing this for.
Since you didn't mention any shells here, I can't say if this is correct
or wrong and in what ways it could be wrong.  Try this in sh(1):

	sed -e "s/','/|/g" lala

- Giorgos



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030410191953.GB11398>