okbob / pspg

Unix pager (with very rich functionality) designed for work with tables. Designed for PostgreSQL, but MySQL is supported too. Works well with pgcli too. Can be used as CSV or TSV viewer too. It supports searching, selecting rows, columns, or block and export selected area to clipboard.
BSD 2-Clause "Simplified" License
2.48k stars 86 forks source link

CSV - option to ingore odd quotation mark #161

Closed B-z-F closed 3 years ago

B-z-F commented 3 years ago

When there is odd quotation mark in csv file, eg. filename.csv:

column_A:column_B:column_C
1_A:1_B:1_C
2_A:2_"B:2_C
3_A:3_B:3_C

then with command pspg --csv --csv-separator : --csv-header on filename.csv it shows everything after quotation mark (resp. from previous separator before quotation mark) in one cell.

It will be nice to have an option to ignore (odd) quotation mark.

okbob commented 3 years ago

I am not sure if I want to implement this idea. Your example is not valid CSV document. CSV allows multiline quoted values - so missing quote on same line doesn't mean broken format. It is better to clean data before, than creating some heuristics to display some data in broken format.