3

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

underdark
84.9k22 gold badges237 silver badges418 bronze badges
asked Oct 10, 2013 at 8:03
12
  • 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. Commented Oct 10, 2013 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? Commented Oct 10, 2013 at 8:21
  • Thanks @DevdattaTengshe for your prompt response. Please see above screenshot of the file in text editor. Commented Oct 10, 2013 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. Commented Oct 10, 2013 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"? Commented Oct 10, 2013 at 8:54

2 Answers 2

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

answered Oct 10, 2013 at 15:26
1
  • 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. Commented Oct 10, 2013 at 16:27
2

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

answered Nov 19, 2014 at 0:45

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.