I'm experimenting with adding fields to attribute table data in QGIS 2.14.5LTR (mainly
*.csv files) and stumble into a variety of issues or some things I do not understand, respectively. I imported a csv file via
import text file as layer button, drag and and dropped the same file to the project and saved the latter as csv from QGIS.
My s(i/a)mple project looks like this (note the edit state of the layers):
1st scenario - import
*.csv file and trying to add a field with field calculator.
When opening a
*.csv file and trying to do so, I'm only able to add a virtual field to the table (Which can obviously not be used for joins, which is the aim of the game in the end). Strange enough: When dragging the same file into the project, I'm able to toggle editing mode and add new fields.
*.csv file looks like this (no column headers):
92891A14.1;Eigenausbau;92891A14;09475169;Bayern;Hof, Landkreis;95131;Schwarzenbach;Döbra;Tannenweg;3;;2;4475738;5571977;272;11,99;11300;;30001;;100001; 92891A17.32;Eigenausbau;92891A17;09475169;Bayern;Hof, Landkreis;95131;Schwarzenbach;Schwarzenbach;Thiemitztalstr.;11;;1;4472917;5572009;432;16,61;12430;;30001;;90001; 92891A30.31;Eigenausbau;92891A30;09475169;Bayern;Hof, Landkreis;95131;Schwarzenbach;Schwarzenbach;Hochstr.;26;;15;4473440;5571918;147;4,78;13560;;30001;;100001; 92891A1.69;Eigenausbau;92891A1;09475169;Bayern;Hof, Landkreis;95131;Schwarzenbach;Schwarzenbach;Hauptstr.;16;;1;4473041;5571724;428;16,93;12430;;30001;;90001;
2nd scenario - saving the opened csv file as csv
Done so, I'm now able to switch to toggle editing mode and add a new field to the layer the usual way:
*.csv file looks like
field_1,field_2,field_3,field_4,field_5,field_6,field_7,field_8,field_9,field_10,field_11,field_12,field_13,field_14,field_15,field_16,field_17,field_18,field_19,field_20,field_21,field_22 92891A17.32,Eigenausbau,92891A17,9475169,Bayern,"Hof, Landkreis",95131,Schwarzenbach,Schwarzenbach,Thiemitztalstr.,11,,1,4472917,5572009,432,16.61,12430,,30001,,90001 92891A30.31,Eigenausbau,92891A30,9475169,Bayern,"Hof, Landkreis",95131,Schwarzenbach,Schwarzenbach,Hochstr.,26,,15,4473440,5571918,147,4.78,13560,,30001,,100001 92891A1.69,Eigenausbau,92891A1,9475169,Bayern,"Hof, Landkreis",95131,Schwarzenbach,Schwarzenbach,Hauptstr.,16,,1,4473041,5571724,428,16.93,12430,,30001,,90001 92891A17.31,Eigenausbau,92891A17,9475169,Bayern,"Hof, Landkreis",95131,Schwarzenbach,Schwarzenbach,Thiemitztalstr.,22,,1,4472928,5572055,428,16.47,12430,,30001,,90001
Note: re-importing the saved
*.csv layer leeds to the same issue as in 1st scenario
3rd scenario - Trying to add a field to the saved layer via field calculator from processing toolbox
Further more, attribute tables can not be selected as input layers for the field calculator from the processing toolbox (note the empty dropdown):
What is the difference between the two
*.csvlayers in 1st and 2nd scenario (or the different ways they come into the project)? Why can the saved layer be edited and have fields added and the layer imported from a text file can not, but can, when dragged and dropped to the project?
What is the difference between all the field calculators and is there a way to add fields to a table with any processing tool?