[GIS] MMQGIS: delimiter error on CSV import for merging

csvmergemmqgisqgis

I have a shape of my city and I have a CSV file, containing attributes I'd like to join into the shape of the city. In selection of the CSV file, I get the following error message by MMQGIS.

enter image description here

Source of the CSV: public server of election data. Things I tried to fing the error:

  • converted the file to UTF-8 encoding
  • converted it to ASCII
  • replaced \n with \r\n
  • replaced ; delimiters with | and ,
  • replaces decimal characters with . and ,
  • open and resave in Libre Office
  • open and resave in Notepad++
  • use CSV lint for verification
  • view the file in Libre Office to compare ammount of columns
  • split the CSV (~30 lines) to merge them step by step to find broken lines
  • found the line where the import seems to break
  • still can't find whats broken in this line

Is it possible that this tool is causing the error itself?

Update: I just skipped the first 5 lines and tried the next 5 lines. Works without error. Maybe it is the length of the lines? Or the total ammount of data in the CSV? That would be odd because it is not much data.

If I merge only a few lines, all other lines with no new CSV attributes disappear from my shapefile.

Shapefile: https://www.offenedaten-wuppertal.de/dataset/40c4cc39-08d2-44df-9257-94edc7af3578/resource/40c4cc39-08d2-44df-9257-94edc7af3578

Example data to merge: (Source: https://wahlen.wuppertal.de/BW2017/05124000/html5/Bundestagswahl355.csv)

06;friedrichsberg;7;7;7150;4912;68.7;4834;78;4855;57;1321;27.33;1182;24.35;1635;33.82;1337;27.54;349;7.22;406;8.36;475;9.83;598;12.32;349;7.22;559;11.51;526;10.88;520;10.71;59;1.22;37;0.76;0;0;15;0.31;114;2.36;58;1.19;0;0;12;0.25;0;0;3;0.06;0;0;8;0.16;6;0.12;4;0.08;0;0;1;0.02;0;0;30;0.62;0;0;8;0.16;0;0;9;0.19;0;0;4;0.08;0;0;10;0.21;0;0;4;0.08;0;0;1;0.02;0;0;44;0.91;0;0;5;0.1;
11;brill-arrenberg;6;6;6141;4697;76.49;4659;38;4670;27;1319;28.31;1155;24.73;1433;30.76;1001;21.43;542;11.63;638;13.66;473;10.15;621;13.3;435;9.34;704;15.07;313;6.72;326;6.98;31;0.67;22;0.47;0;0;4;0.09;105;2.25;70;1.5;0;0;5;0.11;0;0;3;0.06;0;0;4;0.09;8;0.17;7;0.15;0;0;0;0;0;0;21;0.45;0;0;11;0.24;0;0;17;0.36;0;0;3;0.06;0;0;20;0.43;0;0;5;0.11;0;0;4;0.09;0;0;27;0.58;0;0;2;0.04;

Best Answer

I opened your csv in a notepad and I can see that a few of your decimals are actually commas e.g. "0,00". Fix these and you should be good to go.

Related Question