Need to Quickly Add Multiple Layers From Multiple Folders To QGIS Project

What you need is the QGIS plugin Load Them All. Apart from loading files from several directories at once, you can:

  • Reflect the directory structure in the QGIS Table of Contents (by means of nested layer groups).
  • Apply alphanumeric filters so that you just load layers that match your filter (think of regular expressions).
  • Load only certain geometry or raster type (e.g., only polygon vectors or Multiband rasters).
  • Load only certain file extensions (e.g., only .shp files).
  • Load only layers that lie inside or that intersect a given bounding box.

and more. Have a look at https://github.com/gacarrillor/loadthemall for more details.

enter image description here


As an alternative to using a plugin, you can give the Add Layer command a semicolon-delimited list of files. You can create such a list in the following manner:

cd /d <Path_to_the_directory_where_your_files_are>
dir *.shp /s /b >All.txt

This gives you a file named All.txt, which contains the paths to all the files with a specific extension (you can use a different mask depending on the files you have), where each file is on a new line.

D:\Data\01\data01_1.shp
D:\Data\01\data01_2.shp
D:\Data\02\data02_1.shp
D:\Data\02\data02_2.shp

Then simply replace all newlines with ; using a text editor (like Notepad++) and paste the result in the Add Vector Layer... dialog.

For Notepad++ you need to change the replace mode to Extended and replace \r\n with ;. You would get a file that looks like this:

D:\Data\01\data01_1.shp;D:\Data\01\data01_2.shp;D:\Data\02\data02_1.shp;D:\Data\02\data02_2.shp