2

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").

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

1 Answer 1

1

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

4
  • 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. Jan 28, 2017 at 23:55
  • By using the "Record options", it just deletes rows, not columns unfortunatly. Thanks for the answer.
    – Nina
    Jan 29, 2017 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. Jan 30, 2017 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, 2017 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.