[Qgis-user] .csv table

Garth Fletcher garth at jacqcad.com
Fri May 26 12:44:57 PDT 2023


Burt Grabowski wrote:

> ?Dear all, first of all I want to quickly introduce myself. My name is 
> Burt and I am a student of economics in Austria. I have a special 
> request, because I am an absolute beginner in QGIS, but have no time 
> left. I am writing on my diploma thesis and my supervisor wants to 
> have some cards in it. I spent a whole week, but I am not able to 
> connect a simple .csv file with the shape file. I would probably need 
> 10 to 15 minutes, so who would please have some time left for me for a 
> zoom call, so that I can create some tables for my diploma thesis? I 
> would like to create them over the weekend, because my deadline is 
> getting closer and I cannot find one description of my simple problem. 

Nicolas Cadieux has replied many times via QGIS-User Digest but perhaps you did not see his replies and offers of help.

Assuming you have a shape file containing some objects, and
you have a .csv file containing lines which should connect to those objects

You need to have (or create) a field in the .CSV file whose contents matches a field in the shape file.
It could be simply a number, or a string.  The important thing is that the content of the field in the shape file will match the content of the field in the .csv file.

For example if the Shape file contains a field ShpTag
and the .csv file contain a field named CsvTag of the same type

Load the .csv file as a layer using the Data Manager's  Delimited text option
   {note: if the 1st line in the .csv contains column names, they will be used as field names}

You then open the shape layer dialog and use the "join" pane to
  a) identify the .csv file layer
  b) identify the field in the .csv file (CsvTag)
  c) identify the field in the shape file (ShpTag)

Each object in the shape file will then have appended to its attributes the .csv contents from the line in the .csv file in which the contents of ShpTag matched the contents of CsvTag.


Very easy and very powerful.

Hope the above helps more than it confuses...

-- 
Garth Fletcher



More information about the QGIS-User mailing list