How can I load multiple CSV files into QGIS with Longitude/Latitude already included in it.

I downloaded the "Load Them All" plug-in, however, the result loaded was converted as text files and cannot be visualize on the map canvass. Any help?

Are there any available plug-ins that can load multiple CSV file that will work fine in QGIS?

  • 1
    You could ask for that feature at github.com/gacarrillor/loadthemall/issues Just open a new issue describing what would you like to have. It would be nice to add it to Load Them All. Oct 4, 2016 at 3:53
  • How are the multiple csv files different from each other?
    – BillW
    Nov 28, 2016 at 5:05

3 Answers 3


You could use the following code in the Python Console to locate your csv files in a specified folder and load them as point shapefiles using their longitude/latitude fields. The code assumes:

  • The csv file is comma-separated
  • The longitude/latitude field names are "x" and "y" respectively
  • The CRS of the loaded layers will be in EPSG:4326

But you can edit this:

import glob, os

# Define path to  directory of your csv files
path_to_csv = "C:/Users/You/Desktop/csv folder/"  

# Set current directory to path of csv files
# Find each .csv file and load them as vector layers
for fname in glob.glob("*.csv"):  
    uri = "file:///" + path_to_csv + fname + "?delimiter=%s&crs=epsg:4326&xField=%s&yField=%s" % (",", "x", "y")
    name = fname.replace('.csv', '')
    lyr = QgsVectorLayer(uri, name, 'delimitedtext')

In the new version o QGIS, the command QgsMapLayerRegistry.instance().addMapLayer(lyr) was discountinued. The solution is still valid if we substitute the former line by: QgsProject.instance().addMapLayer(lyr) Also you need to delete or comment the second line from qgis.core import QgsMapLayerRegistry

The solution works perfectly.

  • 1
    Thanks to all your comments...it really works except for the one's saved as .csvt files.
    – user83721
    Oct 4, 2016 at 15:38
  • @wgs84 - Most welcome, glad it worked :)
    – Joseph
    Oct 5, 2016 at 11:19

You might need csvt files along your CSV files to tell QGIS where it should find the geometry.

The plugin might use Add Vector layer in the background, not Add delimited text which does some educated guess on the geometry columns.


There is a cool QGIS plugin that does so. It's name is CSV Batch Import.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.