Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Apr 2003 12:47:05 -0400 (EDT)
From:      Andy Harrison <ah54@httpsite.com>
To:        =?iso-8859-1?q?adrian=20kok?= <adriankok2000@yahoo.com.hk>
Cc:        questions@FreeBSD.org
Subject:   Re: sed to remove pattern ','
Message-ID:  <XFMail.20030410124705.ah54@httpsite.com>
In-Reply-To: <20030410163001.63667.qmail@web21201.mail.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
On 10-Apr-2003, adrian kok wrote message "sed to remove pattern ','"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> 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
> 

For one thing, you don't have a trailing quote.  Even still, it's easier just
to use double quotes in a case like this:


# echo \',\' | sed "s/','/|/g"
|
#

~~ 
Andy Harrison
ah##@httpsite.com
ICQ: 123472  AIM/Y!: AHinMaine
[full headers for details]

-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5.8

iQCVAwUBPpWgB1PEkLgodAWVAQHE6AP/fyQocZK0y21EJmis+Ob7YuCZY9gbbOD/
ARF4rTdo9gL0/5xcbTITqSt3kMeH/XQm7qFoiS+KnzCdYaJwns85wjvITOjBWq3x
XBzBDiNP+Td5DxDlcZX0BUQ/HMTw7nYL7stoi4iC1vu2Y90XiohBzHFlH1I8dzd1
HDeiwvZ+daU=
=8FrY
-----END PGP SIGNATURE-----



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