Re: Extending copy_expert - Mailing list psycopg

From Rich Shepard
Subject Re: Extending copy_expert
Date
Msg-id alpine.LNX.2.11.1410121449020.25325@localhost
Whole thread Raw
In response to Extending copy_expert  (Andrea Riciputi <andrea.riciputi@gmail.com>)
List psycopg
On Sun, 12 Oct 2014, Andrea Riciputi wrote:

> However the target software for which the file is produced, is, let say,
> “legacy” software and can only accept CRLF as EOL character. However by
> calling COPY TO STDOUT from psycopg ends up in a CSV file with LF as EOL
> forcing us to pass the file a second time to convert EOL, which is
> inconvenient. Plus, doing it in Python, make it a little bit to slow.

Andrea,

   How about using unix2dos or todos? These linux utilities translate line
endings. When I get client data in text form with the CR/LF ends I translate
them to LF (\n) with fromdos (or the older flavor called dos2unix). It's
quick, but I've not tried them on a 500G file.

HTH,

Rich


psycopg by date:

Previous
From: Andrea Riciputi
Date:
Subject: Extending copy_expert
Next
From: Adrian Klaver
Date:
Subject: Re: Extending copy_expert