I am using the odk app to collect data and a heading of the form is required.

This heading is imported in QGIS as column as well, when I add the data as delimited layer, but it does not contain relevant information. Is there a way to remove certain columns while adding the .csv-file (skiping empty fields does not work)?

Image 1: xls-form (for ODK) enter image description here

Image 2: Attribute Table in QGIS enter image description here

I can delete the columns manuelly afterwards. But would like to know if there is a way to do it automatically (so either in the xls-form or before importing data in the settings of "adding a delimited text layer").

  • Can you include a image example of what this table/data looks like in your question? – artwork21 Jan 27 '17 at 16:11

When importing a Delimited Text Layer in QGIS, you can tell it to ignore a given number of header lines - see the attached screencap, under "Record options." I'm using QGIS 2.18.2 (Las Palmas); I don't know if this is available on earlier versions.

enter image description here

  • Another idea might be to load the whole table, and then select only the relevant records using some appropriate expression (something like fieldA != None), and exporting that selection to a new layer. – Paulo Raposo Jan 28 '17 at 23:55
  • By using the "Record options", it just deletes rows, not columns unfortunatly. Thanks for the answer. – Nina Jan 29 '17 at 16:04
  • Ah, I think I mistook your question for meaning rows, not columns. Well, in either case, I can imagine a relatively simple R or Python script that would read in the file, select only the columns you want, then write a new file which you can give to QGIS. That would be straight-forward data manipulation; not GIS per se. If that sounds helpful, I can probably write a script and post it here. – Paulo Raposo Jan 30 '17 at 16:29
  • Sounds great. I'd really appeciate, if you could help me with the script, as I have never written something similar. – Nina Jan 31 '17 at 20:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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