0

I'm using arcpy.da.SearchCursor to read a csv that has a column with preceding zeros, e.g.:

myCSVColumn
0124578
12598
04589
012568
...

When using the arcpy.da.SearchCursor it returns the value w/o the preceding zeros:

124578
12598
4589
12568

In addition, when using Table to Table method it returns the same result. Does anyone know a workaround for this besides opening the csv with python and parsing through it to get the values?

1

I have run into a similar problem in the past. ArcGIS was importing columns as interger and truncating leading zeros. ArcGIS uses its own method of determining column types. I had to specifically tell ArcGIS that the attribute column was to be text by using a schema.ini file.

This is the article I used to get started.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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