I've requested a table dump from our ops division and received something like this (psql's ASCII output):
session_key | expire_date ----------------------------------+------------------------------- hj37s34265p700mvcaspvi26uy44bdtk | 2013-07-15 04:36:34.976036+02 nsoz2mpv4k08p3dlksdp6sbbfxe7wlp5 | 2013-07-15 04:36:35.881375+02 2m756uty41c8se0x38phg0j7igxys2ey | 2013-07-15 04:36:45.016556+02 m6aymeoh5cww1okwgi6fdnpaj6pkgmgv | 2013-07-15 04:36:45.925033+02 i9k6fk109oq30l2r9mddvns5xttpc4t9 | 2013-07-15 04:36:55.061302+02 n5cnsapikja5fyp0e1ft1egzmxkmd2o0 | 2013-07-15 04:36:55.96498+02 nm3crm9okoe2ghz5jnnyxdml8v75vm5p | 2013-07-15 04:37:05.108491+02 xfomkqrjuf09ffw2rk8uyc6nc93bo2qc | 2013-07-15 04:37:06.001869+02 tz12zlg3sode7r2jsfy1b7mye0887bgk | 2013-07-15 04:37:15.133397+02 3jxqsmhig3ee8eeqhw6xogwouz8b3ttx | 2013-07-15 04:37:16.048274+02 (10 rows) I've starting parsing this with sed, grep, etc., but wondered: is there a way to convert this somewhat regular output to something easier to analyse like CSV?
EDIT: I do not have any access to the actual database in question, all I have is the ASCII output as text file, which I'd like to convert to CSV with PostgreSQL's own means (e.g. on a separate test database).
\copycommand which generates client side CSV files, or the SQLcopycommand (note the missing backslash) which generates server side CSV files (or any other SQL tool that can export to CSV)