Ciao Tonino,

if you are comfortable using python, you can circumvent the automatic
trimming of leading and trailing zeros by adding your CSV layer from
python. From the API documentation
http://qgis.org/api/classQgsVectorLayer.html in the "*Delimited text file
data provider*" Section, you'll see that by setting the *trimFields *flag
to "no" your leading zero shouldn't be removed anymore.

P.S. If you are interested, I can try to help you with writing a python
script. Feel free to contact me in private.

*Nicola Poles*

*SOC Settore Tecnico-Scientifico*

*ARPA Friuli Venezia-Giulia*

*Via Cairoli, 14 – 33057 Palmanova (UD)*

*Tel. 0432-191 8073 (8199)*

*e-mail: nicola.po...@arpa.fvg.it <nicola.po...@arpa.fvg.it> *

On Wed, Jul 29, 2015 at 10:18 AM, CONTI Tonino <t.co...@comune.jesi.an.it>
wrote:

>  Dear all,
> Can anyone tell me how to prevent qgis automatically convert a csv file
> from text field to numeric format (double).
> I have a csv file where a field contains texts starting with zero (example
> : "0420050000000009", with the quotes).
> When I add to my project file as "layer delimited text," I see the data
> properly in the preview but when the layer is added in this field is not
> imported the leading zero recognizing the format as numeric.
> I need that the string "0420050000000009" remains unchanged as it
> represents a unique identifier.
> can you help me?
> Thank You
> Tonino
>
>
>
>
>
> *Dott.Tonino Conti*
> *Comune di Jesi*
> *Sistema Informativo Territoriale*
> * Tel 0731538312 - fax 0731538513*
> *t.co...@comune.jesi.an.it <t.co...@comune.jesi.an.it>*
> *www.comune.jesi.an.it/sit <http://www.comune.jesi.an.it/sit>*
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user
>
_______________________________________________
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to