I'm having trouble importing a CSV file as a points layer. I have done this many times in the past but I think some setting has changed. QGIS no longer autodetects the appropriate x/y fields, and even if I choose them, it adds it as a table and not a point layer.
I have two types of CSVs. One works, one doesn't.
The first (the one that works) is comma separated, with no quotation marks around each entry.
And the type that doesn't work is comma separated but has quotations around each entry - "xxx","xxx" example here:
"Name","UTM Easting","UTM Northing","Colour","Remarks","Image File Name","Size","Activity","Location","Unit","Time","Equipment","Date","Altitude Meters","MGRS","Lat/Lon DD","Lat/Lon DMS","UTM","UTM Zone","Image path"
"Y 4","367984","6152970","yellow","","","","","","","","","2025年01月24日T05:30:35.462Z","1,450 m MSL","10U CG 67984 52970","N 55.50496° W 125.09025°","N 55° 30' 17.87"" W 125° 05' 24.90""","10U 367984 6152970","10U",""
"Y 5","434641","6160969","yellow","","","","","","","","","2025年01月24日T05:30:35.926Z","873 m MSL","10U DG 34641 60969","N 55.59029° W 124.03703°","N 55° 35' 25.05"" W 124° 02' 13.31""","10U 434641 6160969","10U",""
"Y 6","442674","6097619","yellow","","","","","","","","","2025年01月24日T05:30:36.605Z","1,214 m MSL","10U DF 42674 97619","N 55.02211° W 123.89666°","N 55° 01' 19.60"" W 123° 53' 47.97""","10U 442674 6097619","10U",""
"Y 7","371544","6096743","yellow","","","","","","","","","2025年01月24日T05:30:37.085Z","908 m MSL","10U CF 71544 96743","N 55.00097° W 125.00829°","N 55° 00' 03.49"" W 125° 00' 29.86""","10U 371544 6096743","10U",""
What settings must I change in order for it to autodetect the x/y fields and add it as a point layer for the .csv with the quotations? The coordinates im using is the UTM easting and UTM northing columns.
1 Answer 1
If you have copy-pasted the CSV data correctly, it seems to contain invisible control marks, "left-to-right mark" LRM
https://unicode-explorer.com/c/200E
The first thing to do is to clean the data.
-
can you tell me how i would clean the data?boreal– boreal2025年01月24日 16:13:30 +00:00Commented Jan 24 at 16:13
-
Im using Libre Office Calc. Is the "LRM" in your screenshot of my text showing up for you when pasted into another program? Wondering why i dont see that on mine I copy and pasted this text from a "mousepad" on a linux systemboreal– boreal2025年01月24日 16:19:26 +00:00Commented Jan 24 at 16:19
-
1You can remove via commandline
col -b < bad.csv > clean.csv
user2856– user28562025年01月25日 08:40:17 +00:00Commented Jan 25 at 8:40 -
I pasted the CSV text from your question and pasted it into Notepad++. The hidden LRM marks are shown when the option "Show all characters" is used. By default Notepad++ does not show the hidden characters and many text editors cannot show them at all. Libre Office seems to have some configuration option for left-to-right/right-to-left ask.libreoffice.org/t/changing-back-and-forth-rtl-and-ltr/52739.user30184– user301842025年01月25日 14:25:46 +00:00Commented Jan 25 at 14:25
-
1@boreal LibreOffice Calc can't show nonprinting characters. If you open in a programming text editor like Visual Studio Code you'll see them (in VS Code they display as
[U+200E]
but they're the same nonprinting LRM character. Just remove via my commandline method above.user2856– user28562025年01月26日 02:23:21 +00:00Commented Jan 26 at 2:23