In QGIS, I have a problem deleting the same column out of different shapefiles, is there a way to do this?
I want to delete several columns out of all these layers, is there a way to do this without opening each individual attribute table and manually selecting the fields
Best Answer
A PyQGIS solution. Tested on QGIS 3.24.1-Tisler.
Proceed with
Plugins > Python Console > Show Editor
and paste one of the scripts below.The press
Run script
and get the output.This approach will directly modify the existing layer
Partially inspired from @MrXsquared's deleted answer.
Before:
After:
This approach will only create a temporary layer from the existing layer
Another option is to use the "Drop field(s)" geoalgorithm via
"native:deletecolumn"
.References: