1

When reading a column of integers (land cover classes) from a CSV file, ArcMap (10.5) automatically assigns a field type of 'string', rather than a number format (e.g. 'Long'). This makes it so you cannot use that field for symbology or mathematical operations. Strangely, ArcMap reads the column of numbers from an original CSV as integers, but not from the version modified in Excel.

While I could add a field and then use field calculator to convert the string values to numeric, which is the only solution I could find online, this shouldn't be necessary. There must be a way to get numeric fields in CSVs to be interpreted as numeric, as most CSVs work fine.

Edit: This question differs from the suggested duplicate in that it relates to CSV files and not excel files. Also the CSV file is not being imported with Table to Table, or Excel to Table, but is being used directly as a table in arcpy. The workaround also differs from those other 'solutions', which are also just workarounds. None of the workarounds, including my own, explain the fundamental underlying reason why ArcMap only sometimes decides to read number columns as text. Calling them solutions is like a doctor saying that a painkiller will cure the disease. I don't want to have to convert the file unnecessarily.

Where is the real solution to why ArcMap only sometimes interprets a number column as text?

0