[Melbourne-pm] Text::CSV null output options?
toby.corkindale at strategicdata.com.au
Mon Jun 30 23:03:17 PDT 2014
Would it be simpler to just insert the data directly into Postgres rather than using an (antiquated, limited) intermediate data format?
----- Original Message -----
> From: "Malcolm Herbert" <melbourne-pm at mjch.net>
> To: melbourne-pm at pm.org
> Sent: Tuesday, 1 July, 2014 3:48:42 PM
> Subject: [Melbourne-pm] Text::CSV null output options?
> Is there a way to tell Text::CSV _not_ to escape certain strings?
> Alternatively, can Text::CSV be told to emit a particular string on an
> undefined value? The manual page implies 'no' ...
> Would some other CSV-manipulating module be better suited for this?
> I'm writing some simple scripts to rip apart some Excel files I've been
> given and inject these into a PostgreSQL database to do slightly more
> interesting things on the data therein.
> I've been using Spreadsheet::ParseExcel to read the data but felt that I
> was recreating the wheel with my own code to output these records as a
> TSV file
> In an attempt to avoid rework I've started using use Text::CSV however
> the problem I'm facing now is that there doesn't appear to be a way to
> tell Text::CSV not to escape the \N strings I need to appear in the
> output so that PostgreSQL interprets these fields as NULL
> Has anyone else faced this issue before?
> Malcolm Herbert
> mjch at mjch.net
> Melbourne-pm mailing list
> Melbourne-pm at pm.org
More information about the Melbourne-pm