#6994 closed defect (fixed)

XLSX write overrides the first row with column names

Reported by: alculquicondor Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: 2.2.1
Severity: normal Keywords:


This was tested with ogr2ogr. The data of the first row is lost because it is overwritten with the column names.

Both versions 2.2.1 and 2.1.4 present the issue.

Attachments (1)

New Dataset.shp.zip (1.7 KB) - added by alculquicondor 17 months ago.
Sample shp

Download all attachments as: .zip

Change History (4)

comment:1 Changed 17 months ago by Even Rouault

Please paste the ogr2ogr command line you're using and attach a input file, as minimal as possible to reproduce

Changed 17 months ago by alculquicondor

Attachment: New Dataset.shp.zip added

Sample shp

comment:2 Changed 17 months ago by alculquicondor

The problem seems to be option preserve_fid.

ogr2ogr -f XLSX test.xlsx New\ Dataset.shp -preserve_fid

comment:3 Changed 17 months ago by Even Rouault

Resolution: fixed
Status: newclosed

In 39774:

XLSX: avoid 'ogr2ogr -f XLSX out.xlsx in.shp -preserve_fid' to overwrite the first record. Note however that FID preservation itself doesn't really work with XLSX (fixes #6994)

Note: See TracTickets for help on using tickets.