[Qgis-user] Csv file.

Ourizo Cacho usuario7 at gmx.es
Mon May 26 10:29:59 PDT 2014


Hi again,

thanks Richard you for your explanation, it sounds perfectly reasonable 
the way you put it down.
I´ll simply rename starting with a single letter.
Thank you, Joao, Mica and Alexandre too.

Have a nice day!



El 26/05/2014 19:08, Richard Duivenvoorde escribió:
> Hi, QGIS uses gdal to open csv files, more specifically this csv driver:
>
> http://www.gdal.org/drv_csv.html
>
> you can easily test that it is not QGIS fault by doing:
>
> ogrinfo -al test.csv
>
> from that page:
>
> The driver attempts to treat the first line of the file as a list of
> field names for all the fields. However, if one or more of the names is
> all numeric it is assumed that the first line is actually data values
> and dummy field names are generated internally (field_1 through field_n)
> and the first record is treated as a feature. Starting with GDAL 1.9.0
> numeric values are treated as field names if they are enclosed in double
> quotes.
>
> so either (as other say here) make all names start with a alfanumeric,
> OR put quotes around them;
>
> With original one:
>
> ogrinfo -al test.csv
> INFO: Open of `test.csv'
>        using driver `CSV' successful.
>
> Layer name: test
> Geometry: None
> Feature Count: 3
> Layer SRS WKT:
> (unknown)
> field_1: String (0.0)
> field_2: String (0.0)
> field_3: String (0.0)
> OGRFeature(1):1
>    field_1 (String) = NAME
>    field_2 (String) = 2013
>    field_3 (String) = 2014
>
> Double quoted first line:
>
> ogrinfo -al quoted.csv
> INFO: Open of `quoted.csv'
>        using driver `CSV' successful.
>
> Layer name: quoted
> Geometry: None
> Feature Count: 2
> Layer SRS WKT:
> (unknown)
> NAME: String (0.0)
> 2013: String (0.0)
> 2014: String (0.0)
> OGRFeature(2):1
>    NAME (String) = REGION1
>    2013 (String) = 1000
>    2014 (String) = 2000
>
> Regards,
>
>
> Richard Duivenvoorde
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user
>


---
Este mensaje no contiene virus ni malware porque la protección de avast! Antivirus está activa.
http://www.avast.com




More information about the Qgis-user mailing list