Re: Converting comma-delimited data to tab-delimited - Mailing list pgsql-general

From Frank Finner
Subject Re: Converting comma-delimited data to tab-delimited
Date
Msg-id XFMail.020331210413.postgresql@finner.de
Whole thread Raw
In response to Converting comma-delimited data to tab-delimited  (Randall Perry <rgp@systame.com>)
List pgsql-general
Hi,

if you just want to replace all commas by tabs, try this one:

perl -ne 's/,/\t/g; print $_;' file.csv > file.tab

mfg Frank.

On 31-Mar-02 Randall Perry sat down, thought for a long time and then
wrote:
> 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@systame.com
>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org

--
Frank Finner

Thus we are all responsible for one another, through all the myriad
dimensions of time and space that make up the multiverse . . .
                              (M. Moorcock, "The Revenge Of The Rose")

pgsql-general by date:

Previous
From: Randall Perry
Date:
Subject: Re: Converting comma-delimited data to tab-delimited
Next
From: Randall Perry
Date:
Subject: Re: Converting comma-delimited data to tab-delimited