Re: proper export table to csv? multilineproblem.

From: Reid Thompson <Reid(dot)Thompson(at)ateb(dot)com>
To: peter pilsl <pilsl(at)goldfisch(dot)at>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: proper export table to csv? multilineproblem.
Date: 2007-02-26 18:21:46
Message-ID: 1172514106.15824.57.camel@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 2007-02-26 at 13:20 -0500, Reid Thompson wrote:
> On Mon, 2007-02-26 at 14:54 +0100, peter pilsl wrote:
> > I need to export several tables as csv. I use the \f-command to set the
> > seperator and pipe the output of my select directly to a file.
> >
> > Unfortunately thats all the control I have over the created csv-file. I cannot
> > set the field-delimiter and - which is critical to me - I cannot set an
> > alternate record-seperator (newline at the moment). The latter is important to
> > me cause many of my fields-values have \n or \r in it, so the csv-import-filter
> > has a hard time to distinguish the record-seperator from a newline inside the data.
> >
> > On the server I've postgres7.2, so the COPY-command does not know about the
> > CSV-option yet (not does the postgres 8).
> >
> > Is there any ready tool to create flexible csv-files or any trick I did not find
> > out yet?
> >
> > thnx,
> > peter
> >
> tablename=>\pset fieldsep ,
> tablename=>\pset recordsep ^
sorry, forgot to set unaligned data mode....

tablename=>\a

In response to

Browse pgsql-general by date

  From Date Subject
Next Message RPK 2007-02-26 18:23:43 Re: Composite Keys
Previous Message Reid Thompson 2007-02-26 18:20:23 Re: proper export table to csv? multilineproblem.