[gdal-dev] OGR CSV oddity

Scott public at postholer.com
Sat Jun 17 08:54:44 PDT 2023


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 data types with the same result.

Pseudo suggestion:
header += header.length ? "," + colname : colname

-- 
www.postholer.com


More information about the gdal-dev mailing list