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?


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


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.

Col2=myValues Long
  • 1
    Are you sure that works? ogr uses a csvt file format. – Nathan W Apr 12 '13 at 1:45

Not the answer you're looking for? Browse other questions tagged or ask your own question.