Re: Converting comma-delimited data to tab-delimited
От | Frank Finner |
---|---|
Тема | Re: Converting comma-delimited data to tab-delimited |
Дата | |
Msg-id | XFMail.020331210013.frank@finner.de обсуждение исходный текст |
Ответ на | Converting comma-delimited data to tab-delimited (Randall Perry <rgp@systame.com>) |
Список | 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 по дате отправления: