I have seen all the questions for how to export an attribute table to Excel from QGIS, and I try all the answers like copy paste, CSV (in fact this I do not know where to find), but none seems to be the right answer.
Can anyone help me?
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.
Sign up to join this communityI have seen all the questions for how to export an attribute table to Excel from QGIS, and I try all the answers like copy paste, CSV (in fact this I do not know where to find), but none seems to be the right answer.
Can anyone help me?
QGIS v3.x
Right click on the layer in the Table of Contents (aka. legend or layer tree) and open the Save As...
dialog.
Once there, click on the Format
option list and choose MS Office Open XML spreadsheet [XLSX]
.
Note that you also have an option for Libre Office files: Open Document spreadsheet [ODS]
.
ORIGINAL ANSWER (no longer valid):
Install the XY Tools plugin by Richard Duivenvoorde.
Select a vector file from the ToC (that is, make it active).
Go to Vector->XY tools->Save attribute table as Excel file
.
You would need the Python library xlw installed for doing so.
Plugins->Manage and Install plugins
and search for xytools.
Feb 18, 2015 at 14:27
xytools
folder in USER/.qgis2/python/plugins/
. Then extract the downloaded zip into that location. Restart QGIS and you're done. I see there were modifications to the file excel.py
in the latest version, and I've used the previous one without problems.
Feb 18, 2015 at 16:09
To get a csv file of the attribute table, rightclick on the layer in the legend, select Save As ...
, and change the file format from shapefile to CSV.
You might need to change the separator from comma to semicolon in a text editor if Excel does not like the default separator.
In QGIS versions 3 and above, the easiest way to export an attribute table is to:
Export
and Save features as...
Comma Separated Value [CSV]
in the format
drop-down menuadd saved file to map
at the bottom of the window so that the file does not get added to your project as a data layerThere's also the MMQGIS Plugin which, when downloaded and installed from the toolbar (Plugins > Manage and Install Plugins...), has the tool:
MMQGIS > Import/Export > Attributes Export to CSV File
From QGIS 3.18 (see the Changelog), you can use the "Export to spreadsheet" algorithm available in the QGIS's Processing Toolbox (Ctrl+Alt+T).
It enables to export one or more layers in multiple sheets, to overwrite or append them to existing files. Output formats supported are Excel XLSX and Open Document Spreadsheet ('.ods')
Fine for exporting full layers, otherwise, keep using already mentioned methods in other answers when you need to export selected features to spreadsheet
Export the layer as a shapefile, find the shapefile on your PC. Copy/Rename the filename of the DBF part of the shapefile exportes to be 8 or under characters if it's not. (OLD MS DOS FILENAME ISSUE). Then, drag-drop the DBF right into Excel.
Save as XLS.
The copy paste method right form QGIS made text/character returns in a blob reset to the next row and cause data problems in excel.
X/Y tools is regrettably no longer available in QGIS 3.x. There is another way how to export the attribute table to Excel, without any trouble concerning text encoding, column names and fields containing special characters in foreign languages like e.g. Vietnamese,. However, your input file should be in UTF-8 encoded: