I am attempting to create a .dbf or geodatabase table from a csv. At first i attempted to just use the 'Table to Table' tool. I set up the field mappings and everything just right but when i run the tool it completes in mere seconds and says it has done so successfully. However, when i attempt to find the output table there is nothing there. I tried to use the 'Excel to Table' tool, same result. I even went so far as to create the table using arcpy and looping through the csv row by row and inserting those rows into the table with an insertcursor. I even had it print each row right before inserting.
the last portion of the code:
readcsv = csv.reader(opencsv)
for row in readcsv:
if "API" not in row[0]:
print row
icursor.insertRow(row)
a sample of the output:
['5067088870000', '0.000', '30.670', 'IGNACIO-BLANCO', 'PICTURED CLIFFS']
['5067065920000', '0.251', '370.725', 'IGNACIO-BLANCO', 'PICTURED CLIFFS']
['5067062590000', '0.390', '1021.573', 'IGNACIO-BLANCO', 'PICTURED CLIFFS']
['5067062570000', '0.446', '1100.212', 'IGNACIO-BLANCO', 'PICTURED CLIFFS']
['5067050960000', '0.131', '952.399', 'IGNACIO-BLANCO', 'MESAVERDE']
['5067088870000', '0.000', '1524.118', 'IGNACIO-BLANCO', 'MESAVERDE']
['5067052140000', '7.215', '5309.192', 'IGNACIO-BLANCO', 'PICTURED CLIFFS']
['5067051470000', '0.000', '1051.158', 'IGNACIO-BLANCO', 'MESAVERDE']
['5067052460000', '0.121', '2409.044', 'IGNACIO-BLANCO', 'MESAVERDE']
['5067055830000', '0.000', '3503.423', 'IGNACIO-BLANCO', 'MESAVERDE']
['5067052190000', '0.000', '972.064', 'IGNACIO-BLANCO', 'MESAVERDE']
['5067063900000', '0.476', '1023.767', 'IGNACIO-BLANCO', 'PICTURED CLIFFS']
['5067062600000', '0.121', '4221.302', 'IGNACIO-BLANCO', 'MESAVERDE']
Still nothing, the table exists but it is empty. I'm not sure what else i can do to try and get this data into a .dbf or preferably a geodatabase table.
Any help would be greatly appreciated.
What does the code snippet generated from the GUI look like? Maybe the GUI is passing an argument incorrectly.
Can you try casting the numerical data to an appropriate numerical data type?
[int('5067088870000'), float('0.000'), float('30.670'), 'IGNACIO-BLANCO', 'PICTURED CLIFFS']
vs.
['5067088870000', '0.000', '30.670', 'IGNACIO-BLANCO', 'PICTURED CLIFFS']
Put a header row in to define the columns. could be as simple as that
I used your data, added a header/column name row. I used numpy's genfromtext function rather than the python csv module, and got what is needed to make a table (in my case.. NumPyArrayToTable) which can be used in Pro. There are other ways, but sometimes the obvious helps, because I think your data is being assessed in bulk making the lowest data type prevail (text), when I had headers, each Column is looked at for a 'probable' data type and it retained the integer, float and string columns