Add delimited text layer (*.txt, *.csv)

In this section, a simple text file will be added to QGIS to visualize and analyse it spatially (for more information about this refer to section

  1. Open Layer.
  2. Choose Add Delimited Text or click the appropriate button from the Manage Layers toolbar (Table 5).
  3. Choose the source text file (in our case the comma delimited textfile points_table.csv).
  4. Give a name to the output layer (e.g. bees_colony_locations_tab) .
  5. Select the appropriate delimiters (e.g. semicolon or comma) and the columns containing the coordinates in East (X) and North (Y) according to Fig. 75.
  6. Click OK.
  7. Choose the CH1903/LV03 projection from the CRS selector list.
  8. Click OK.
  9. Go to File.
  10. Click Save Project.

As a result, the honey bee colonies are shown as point information on top of the Map View (Fig. 76). It is important to note, that this layer is loaded into QGIS and available for any display and map creation purpose and also some basic analysis, but not physically stored as geodata in the file system. To get the full functionality of a point vector file, save this layer e.g. as a shapefile by performing the following steps:

  1. Right-click the layer in the Map Legend (Fig. 68).
  2. Choose the Save as option in the context menu.
  3. Select a file format (in our case it will be an ESRI Shapefile).
  4. Select a target destination folder within the file system (e.g. with the filename bees_colony_locations.shp).
  5. If special text characters are included, choose an encoding that is suitable (e.g. for Western Europe utf-8 or latin1 are good options).
  6. Select the correct CRS (in our case it is CH1903 / LV03).
  7. Enable the option Add saved file to map (Fig. 77).
  8. Click OK.
    A message (“Export to vector file has been completed”) will appear and the layer will be added on top of the Map Legend.
  9. Select the old text file from the Map Legend using a left mouse click.
  10. Press the button remove layer(s) (see Table 5) to remove it from the project – we will only need our newly created shapefile for all future steps.

Using the plugin called “XyTools” (Tab. 4) it is also possible to import Microsoft Excel or OpenOffice spreadsheets, similar to the procedure presented in section

Fig. 75. Create a Layer from delimited text files: By the use of coordinates stored in different columns of a delimited text file, point vector files can be created.


Fig. 76. The map result after import of the honey bee colony locations (red dots). Reproduced with permission of Swisstopo (BA13016).


Fig. 77. Dialog window to save an existing layer as a new vector layer. By the use of this function, file format conversions and even transformations between different coordinate reference systems are possible (defining the target CRS).