From owner-freebsd-questions@FreeBSD.ORG Thu Apr 10 12:19:59 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 73D7937B401 for ; Thu, 10 Apr 2003 12:19:59 -0700 (PDT) Received: from thalia.otenet.gr (mailsrv.otenet.gr [195.170.0.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5FC7743F3F for ; Thu, 10 Apr 2003 12:19:58 -0700 (PDT) (envelope-from keramida@ceid.upatras.gr) Received: from gothmog.gr (patr530-b196.otenet.gr [212.205.244.204]) by thalia.otenet.gr (8.12.9/8.12.9) with ESMTP id h3AJJs72012093; Thu, 10 Apr 2003 22:19:55 +0300 (EEST) Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.12.9/8.12.9) with ESMTP id h3AJJsKD045845; Thu, 10 Apr 2003 22:19:54 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from giorgos@localhost) by gothmog.gr (8.12.9/8.12.9/Submit) id h3AJJrVP045844; Thu, 10 Apr 2003 22:19:53 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Thu, 10 Apr 2003 22:19:53 +0300 From: Giorgos Keramidas To: adrian kok Message-ID: <20030410191953.GB11398@gothmog.gr> References: <20030410163001.63667.qmail@web21201.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030410163001.63667.qmail@web21201.mail.yahoo.com> cc: questions@freebsd.org Subject: Re: sed to remove pattern ',' X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2003 19:19:59 -0000 On 2003-04-11 00:30, adrian kok 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