From owner-freebsd-questions@FreeBSD.ORG Thu Apr 10 09:47:10 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 F075F37B401 for ; Thu, 10 Apr 2003 09:47:09 -0700 (PDT) Received: from pan.gwi.net (pan.gwi.net [207.5.128.165]) by mx1.FreeBSD.org (Postfix) with ESMTP id E265043FB1 for ; Thu, 10 Apr 2003 09:47:04 -0700 (PDT) (envelope-from ah54@httpsite.com) Received: from andy.gwi.net (blake.gwi.net [207.5.142.8]) by pan.gwi.net (8.12.6/8.12.6) with ESMTP id h3AGl40w039568; Thu, 10 Apr 2003 12:47:04 -0400 (EDT) (envelope-from ah54@httpsite.com) Message-ID: X-Mailer: XFMail 1.5.4 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20030410163001.63667.qmail@web21201.mail.yahoo.com> X-Homepage: http://www.nachoz.com X-PGP-Key: RSA-1024 http://www.nachoz.com/andy.pub X-System-Info-DB: PostgreSQL-7.3.2 X-System-Info-RT: rt-3-0-0 X-System-Info-WM: windowmaker-0.80.2 X-System-Info-httpd: apache-1.3.27_4 X-System-Info-OS: FreeBSD 4.8-STABLE #0 Date: Thu, 10 Apr 2003 12:47:05 -0400 (EDT) Sender: aharriso@andy.gwi.net From: Andy Harrison To: =?iso-8859-1?q?adrian=20kok?= 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 16:47:10 -0000 -----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-----