Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra Comma in Field list for CSV Output #1929

Closed
geographika opened this issue Oct 12, 2019 · 2 comments
Closed

Extra Comma in Field list for CSV Output #1929

geographika opened this issue Oct 12, 2019 · 2 comments

Comments

@geographika
Copy link

Expected behavior and actual behavior.

For CSV output with a single field an additional comma is added at the end of the first line containing the field names.

From Even via the mailing list https://lists.osgeo.org/pipermail/gdal-dev/2019-October/050884.html

This is a intended hack. The OGR CSV reader will not accept CSV files whose
header line doesn't contain a field separator, hence the write side adds this
extra column.
That said the historical limitation of the reader not to accept headers with
one field should probably be changed.

Steps to reproduce the problem.

ogr2ogr -f csv my.csv bdry_counpy2.shp -select CTY_NAME

Produces

CTY_NAME,
Lake of the Woods

GDAL version and provenance

GDAL 3.0.1 (x64 Windows build from GIS Internals)

@jratike80
Copy link
Collaborator

Related to https://trac.osgeo.org/gdal/ticket/5283.

@jratike80
Copy link
Collaborator

Version GDAL 3.8.0dev-1d1044ce33, released 2023/09/28 outputs

CTY_NAME
Lake of the Woods

Maybe fixed by the same than #8410.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants