I am working on a project with an attribute table of approx. 5,564,098 rows. I've tried exporting it to Excel using the "save as" CSV or XLS but the data keeps getting cut off. I would ideally like to combine some of the data so that the attribute table is not so large, and I think I could do that either in QGIS or Excel (if I could manage to download the whole table).

The data is % vegetation type (from the Oregon Statewide Habitat Map) within buffer zones surrounding 860 points. There are 75 different vegetation types that I would like to condense into approximately 30 general categories. Does anyone know either how I could do that within QGIS or how I could export a really large attribute table into Excel?

  • 1
    "Large" in databases usually runs into the hundreds of millions to billions of rows. Since Excel is not a database, and manages all the information in memory, it has limits that do not come close to "large": The .xls file format has a limit of 65,536 rows in each sheet, while the .xlsx file format has a limit of 1,048,576 rows per sheet. Please Edit your Question to state how many rows you are trying to export.
    – Vince
    Mar 7 at 16:48
  • 2
    Have you tried using ogr2ogr? In windows terminal: ogr2ogr -f "XLSX" "/home/bera/Desktop/GIStest/output_excel.xlsx" "/home/bera/Drives/data1/data/LMV/a_very_large_shapefile.shp"
    – BERA
    Mar 7 at 17:26
  • 1
    You have 4.5 million more rows than Excel can handle in a single sheet. This seems more an Excel issue than GIS one. You could manipulate a dataset of that size in Python without bothering with Excel.
    – Vince
    Mar 7 at 17:39
  • Thanks, I'll look into that but I don't have experience using Python which is why I am trying to find a way to reduce the number of rows by merging multiple DN values or split the attribute table in a way that I can then use in Excel.
    – Peyton
    Mar 7 at 17:45
  • 1
    You can reduce your categories in QGIS either by adding a new field, selecting those types to be combined and using the calculator to populate the new field with the new value, 30 times, once for each new type. You instead could create a table with two fields, one with the original type and the second with the new type, then join that to current table using the old types. Export the result to a new points or buffers zone layer, or just use the calculator to fill a new field in your current layer with values equal to the joined new type field.
    – John
    Mar 7 at 17:47


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy