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
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to