From owner-freebsd-questions@FreeBSD.ORG Mon Feb 16 17:20:32 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 792E91065740 for ; Mon, 16 Feb 2009 17:20:32 +0000 (UTC) (envelope-from jalmberg@identry.com) Received: from mx1.identry.com (on.identry.com [66.111.0.194]) by mx1.freebsd.org (Postfix) with ESMTP id 16F3E8FC1A for ; Mon, 16 Feb 2009 17:20:31 +0000 (UTC) (envelope-from jalmberg@identry.com) Received: (qmail 41701 invoked by uid 89); 16 Feb 2009 17:20:59 -0000 Received: from unknown (HELO ?192.168.1.110?) (jalmberg@75.127.142.66) by mx1.identry.com with ESMTPA; 16 Feb 2009 17:20:58 -0000 Mime-Version: 1.0 (Apple Message framework v753.1) In-Reply-To: <49999F6B.4020400@gmail.com> References: <49999F6B.4020400@gmail.com> Content-Type: text/plain; charset=WINDOWS-1252; delsp=yes; format=flowed Message-Id: <93A09B23-28A6-4AF6-B8F3-FA607699A63A@identry.com> Content-Transfer-Encoding: quoted-printable From: John Almberg Date: Mon, 16 Feb 2009 12:20:29 -0500 To: freebsd-questions@freebsd.org X-Mailer: Apple Mail (2.753.1) Subject: Re: tab-delimited to csv X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 17:20:33 -0000 On Feb 16, 2009, at 12:16 PM, Adam Vande More wrote: > John Almberg wrote: >> Can anyone suggest a way to convert a tab-delimited file to csv =20 >> using standard unix utilities? I could whip up a Ruby script to do =20= >> it, but I hate to reinvent the wheel. >> >> Thanks: John >> _______________________________________________ >> freebsd-questions@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-questions >> To unsubscribe, send any mail to "freebsd-questions-=20 >> unsubscribe@freebsd.org" > if you just dealing with a few files, you could use thing like vi =20 > or and editor w/ regex capbilites to search and replace tabs w/ =20 > comma's. > > perl -pe =92s/\t/,/g=92 table.tsv > table.csv There's more to csv than commas, though. For example, if one of the =20 fields contains commas, you need to wrap the field with quotes. -- John