TransWikia.com

Exporting attribute table to Excel from QGIS?

Geographic Information Systems Asked by Po Po on August 27, 2021

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?

8 Answers

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):

  1. Install the XY Tools plugin by Richard Duivenvoorde.

  2. Select a vector file from the ToC (that is, make it active).

  3. Go to Vector->XY tools->Save attribute table as Excel file.

enter image description here

You would need the Python library xlw installed for doing so.

Correct answer by Germán Carrillo on August 27, 2021

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.

Answered by AndreJ on August 27, 2021

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.

Answered by northtron on August 27, 2021

There's also the MMQGIS plugin which, when downloaded and installed from the toolbar (Plugins > Manage and Install Plugins...), has the tool:

Attributes Export to CSV File

MMQGIS Attributes Export to CSV File

Answered by Joseph on August 27, 2021

In QGIS versions 3 and above, the easiest way to export an attribute table is to:

  1. Right-click the attribute layer in the layers menu
  2. Select Export and Save features as...
  3. At the top of the program window, select Comma Separated Value [CSV] in the format drop-down menu
  4. Type a file name for the file to be saved
  5. Click the three-dot button next to the file name to choose a path to where the file should be saved
  6. Uncheck any fields you do not want in your resulting file
  7. Optionally (probably) uncheck the add saved file to map at the bottom of the window so that the file does not get added to your project as a data layer
  8. Click the green check mark, OK button

Answered by CW Dillon on August 27, 2021

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:

  1. Right click on the shp file, Export, save features as Open Document Spreadsheet (ODS.
  2. Open the ODS file with LibreOffice or MS Excel.
  3. Save as Excel file (xls or xlsx)

Answered by HaraldVTN on August 27, 2021

  1. Select rows
  2. Copy selected rows to clipboard
  3. Paste in Excel

enter image description here

Answered by BERA on August 27, 2021

From QGIS 3.18, you can use "Export to spreadsheet" algorithm available in Processing Toolbox. 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 to spreadsheet screen capture

Answered by ThomasG77 on August 27, 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