我已经从我们的ops部门请求了一个表转储并收到类似这样的内容(psql
的ASCII输出):
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)
我已经开始使用sed
,grep
等解析此问题了,但是想知道:有没有办法将这种有规律的输出转换为像CSV一样易于分析的内容?