I am trying to convert a .csv file in Python/ArcPy to dBase format.
I am using this code:
import arcpy inputcsv = "D:/2016_08_21.csv" outputfolder = "D:/" arcpy.TableToDBASE_conversion(inputcsv, outputfolder)
That works but the problem is that the first field in the CSV ("DWD_ID") does not always contain integers. At first the IDs start like 10321 and so on but eventually there are letters too. However the Conversion tool recognizes the first value in the field as an integer and sets the field as integer type and later on the other values are kicked out and never appear in the .DBF.
Is there a better way to convert a .csv to .dbf or can I explicitly define the field "DWD_ID" as Text?
I have tried the DBF module of python but I have not been able to successfully convert a csv file to dBase. My output file was always empty. I am only seeking programmatic solutions in Python; I do not want to use any other software.