Weird. Thanks Even!
On 6/17/23 08:58, Even Rouault wrote:
yep, known oddity. Presumably out of caution, the CSV driver refused for
years to open a CSV with a single column, so on the writing side, it
adds this dummy comma. Since recently (3.7.0 I believe), the read side
of the CSV accepts sing
yep, known oddity. Presumably out of caution, the CSV driver refused for
years to open a CSV with a single column, so on the writing side, it
adds this dummy comma. Since recently (3.7.0 I believe), the read side
of the CSV accepts single column header without trailing comma, but the
write side
If I select a single column from a table, the header column name has a
trailing comma. If I select more than 1 column it does not. Example:
ogr2ogr -f CSV -sql "select col1 from table limit 1" /vsistdout/ source.gpkg
Output:
col1,
123
Tested on 3.5.1 and 3.7
I've tried this on various column