TransWikia.com

QGIS not always recognizing the field name from excel files

Geographic Information Systems Asked by DriveThomas on January 12, 2021

I’m importing multiple excel files into QGIS (version 2.18.7) by dragging and dropping them into QGIS. The excel files don’t contain any coordinates but data that I need to join to vector layers.

My problem is, that sometimes, seemingly at random, QGIS chooses not to use the entries in the first row as the field names. Instead the attribute table labels the field field 1, field 2 and so on. I guess I could save all the excel files as CSV files but I’d prefer not to add an additional step.

Is there some setting or import method that I’m missing?

5 Answers

Unfortunately, I believe the extra step to export the Excel file to a .csv file will be necessary.

There have been issues with regards to importing Microsoft Office files in various GIS packages. A lot of this can be due to the drivers for 64 bit operating systems.

It may be worth the experiment to see if what you are attempting will work in a 32 bit version of the operating system.

The one nice thing with exporting a .csv file is the ability to set up a watch file during the text file import, then any changes made to the text file will be reflected in the joined data without having to recreate the join within QGIS.

Correct answer by jbgramm on January 12, 2021

A possible, yet a bit more work-intensive solution is to load those "faulty" files via the "add text dialogue" into Qgis. The dialogue offers a lot of settings which might solve your problem, e.g. setting the coding of the file, the separators or header rows which are to be omitted.

Answered by Erik on January 12, 2021

This issue arises also if one of the column headers is numeric (for instance a year). So the solution is then to change the column header to something non-numeric.

For instance this csv will have the same problem:

test,2025
1,2

Answered by Michel on January 12, 2021

As mentioned by other contributors, this problem can arise from many issues. I was new to this, but I trouble-shooted the issue by checking the .xlsx column headers.

Turns out I had an empty column somewhere between my sets of data. I deleted the empty column and this resolved the issue immediately, meaning I can continue to use the formatting and formulas benefiting from a .xlsx file (would have hated having to go to .csv).

Answered by Dylan on January 12, 2021

I had the same problem. I saw that the attribute table from Excel (with desired field names appearing as the first record) had two or three additional blank fields to the right of the table. I went back to Excel to delete some blank columns to the right of my data, and reloaded it in QGIS and voilá, the field names appear in the right place.

Answered by GeoQuantum on January 12, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP