2

I used to import csv files in previous versions of QGIS using the format below, but when I upgraded to QGIS 2.0 the delimited text layer plugin was changed and I can't import the file anymore. The plugin can't also detect the x,y or long lat field unlike in previous versions. Any ideas how to add the file? Thanks

Format

Sample

Heres what it looks in Text Editor:

enter image description here

  • 1
    It's weird that the different values from same file are appearing in the spreadsheet program that you have, and in Qgis. Can you show us how the data looks in a Text Editor? You should also check the 'First record has field names' option while importing it to Qgis. – Devdatta Tengshe Oct 10 '13 at 8:12
  • 1
    I don't understand where the "Species" field_1 comes from, but it seems the linebreak in your data gets lost. Also, your decimal separator isn't a comma, but a colon apparently. Maybe this mixes things up? – SAnderka Oct 10 '13 at 8:21
  • Thanks @DevdattaTengshe for your prompt response. Please see above screenshot of the file in text editor. – CES Oct 10 '13 at 8:35
  • Thanks too @SAnderka! I don't know why the field looks like that, but the delimiter is a comma. Please see screenshot above. – CES Oct 10 '13 at 8:43
  • But your coordinates use a colon as decimal separator (you have '120.4833333', not '120,4833333'). What happens if you uncheck "Field optopons" > "Decimal separator is comma"? – SAnderka Oct 10 '13 at 8:54
2

I think you have a problem with your text file (encoding ?)

The text file (not with TextEdit !)

enter image description here

The only thing I did is to fix X and Y fields

enter image description here

Result:

enter image description here

  • You're awesome!Thank you so much. I encoded the data using microsoft excel (which I used to do), but when I encoded it using LibreOffice I was able to import it. – CES Oct 10 '13 at 16:27
1

The line breaks are in Classic Mac (CR); they should be in Unix (LF).

I fixed this by opening my file in TextWrangler and changing the line encoding in the save as screen.

Save as screen

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.