2

QGIS keeps reading in my numeric data from .csv files as string data. This means I have to figure out how to read it in with the proper data type, or convert it back to numeric inside of QGIS, neither of which I know how to do. Why is it doing this, and how do I fix it?

RyanKDalton
  • 23,068
  • 17
  • 110
  • 178
user17081
  • 21
  • 2

2 Answers2

1

Take a look at @underdark's tutorial on How to Specify Data Types of CSV Columns for Use in QGIS.

RyanKDalton
  • 23,068
  • 17
  • 110
  • 178
-1

I suggest creating a schema.ini file for your CSV data. If it doesn't exist, create an empty file and call it schema.ini. Edit it following the instructions found here. As an example, if your csv is called output1.csv, and the second column is called myValues and you want to make sure it is read as a long integer, the following would take care of it. You'll need to restart QGIS after creating the schema.ini.

[output1.csv]
Col2=myValues Long
Kevin R Dyke
  • 851
  • 4
  • 9