We have around 500 files in different folders. For QC purpose, we've selected 25 files(we have the list of files/path in excel) out of those 500. Is it possible to open all those 25 files(it might be a shp or tab) in one shot using the file path in excel sheet ?
You can use something like the following code in the Python Console which:
- Reads the first column and gets the path
- Removes the extension (in this case, the
.shp) so that it's not included when adding the layer into QGIS
Adds the layer to QGIS
import csv, os mycsv = csv.reader(open("path/to/csv")) for row in mycsv: layer_path = row layer_name = os.path.basename(layer_path.replace('.shp', '')) iface.addVectorLayer(layer_path, layer_name, "ogr")