From owner-freebsd-isp Mon May 14 8:10: 8 2001 Delivered-To: freebsd-isp@freebsd.org Received: from pitr.tuxinternet.com (pitr.tuxinternet.com [208.32.175.113]) by hub.freebsd.org (Postfix) with ESMTP id CCD5237B423 for ; Mon, 14 May 2001 08:10:05 -0700 (PDT) (envelope-from hugme@pitr.tuxinternet.com) Received: (from hugme@localhost) by pitr.tuxinternet.com (8.11.0/8.11.0) id f4EBFli30794; Mon, 14 May 2001 11:15:47 GMT (envelope-from hugme) Date: Mon, 14 May 2001 11:15:47 +0000 From: Hug Me To: Tom ONeil Cc: freebsd-isp@FreeBSD.org Subject: Re: sed question - phone list Message-ID: <20010514111547.A30769@pitr.tuxinternet.com> References: <3AFFE1CC.E89BA8D7@tacni.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3AFFE1CC.E89BA8D7@tacni.com>; from tom.oneil@tacni.com on Mon, May 14, 2001 at 08:46:52AM -0500 Sender: owner-freebsd-isp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Mon, May 14, 2001 at 08:46:52AM -0500, Tom ONeil wrote: > > > Greetings All; > > I have a script that handles our pop numbers and it requires I change > the format of a large poplist we use for input. > > This is the format - CA,Anaheim,714,408,4411 > and what I need is - CA,Anaheim,714-408-4411 > because I don't enough perl to modify the script and I can't figure out > how use sed to do it. > > awk will do the substitution, but removes the first 2 commas in the > process. > awk -F, '{print $1,$2,$3,-$4,-$5}' poplist you are missing some prans: awk -F, '{ print $1","$2","$3"-"$4"-"$5 }' this should work, I would not suggest sed. unless you need to search for that string within the document. hugme http://www.hugme.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-isp" in the body of the message