Converting comma-delimited data to tab-delimited

From: Randall Perry <rgp(at)systame(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Converting comma-delimited data to tab-delimited
Date: 2002-03-31 17:36:57
Message-ID: B8CCB369.12420%rgp@systame.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Searched through the archives and found this perl one-liner that's supposed
to replace commas with tabs in text files.

It worked in as much as it created the new output file; but the output was
exactly the same as the input.

Anyone know what's wrong? Or have another way to do this?

perl -ne 's/^ *"//; s/" *$//; print join("\t", split(/\" *, *\"/))'
your-table.csv > your-table.tab

--
Randy Perry
sysTame
Mac Consulting/Sales

phn 561.589.6449
mobile email help(at)systame(dot)com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Randall Perry 2002-03-31 19:01:06 Re: Converting comma-delimited data to tab-delimited
Previous Message Joe Conway 2002-03-31 16:08:07 Re: Bytea, ASCII-only encoding and pg_dumpall (Was: Bytea vs. BLOB)