Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Related to Data-type detection in ArcGIS table loading

I have a CSV file which contains a mixture of numeric and text fields:

ID,Txt,Int,Dbl
12345,abc,45,56.78
12346,9,65,23.12
12347,10,66,23.13

According to this Esri article if the top 8 rows contain a text value, the field will be classified as text, yet I am finding that the second field is classified as Long. This means that the value "abc" is omitted:

enter image description here

How can I force ArcGIS to recognise this as a text field, while maintaining the data in CSV format?

A workaround will be to create a geodatabase table, define the field as text, and Load the data, but I'm hoping to keep the table in CSV (it's the output of another process).

Thanks

share|improve this question
2  
Here is the full spec for the record: msdn.microsoft.com/en-us/library/windows/desktop/… Interestingly, it did not fully worked for me... –  Mahdi Jul 26 '13 at 21:45
add comment

1 Answer 1

up vote 10 down vote accepted

Have a look at the "Overriding how text files are formatted" section in the help topic on Adding an ASCII or text file table:

You can override how delimited text files are displayed within ArcGIS by using the schema.ini files. An example of when you would want to use the schema.ini file to override the default behavior is when ArcGIS is misinterpreting a field type. The following example shows how to do this for a field called PLOTS which should be displayed as type Text but is being interpreted as type Double.

[Trees.CSV]
Col14=PLOTS Text

Note that you may need to create a schema.ini file if one is not present and you need to override how delimited text files are displayed in ArcGIS. For more information on the schema.ini file, do a search for schema.ini on the Microsoft MSDN website.

share|improve this answer
    
Thanks for that - it does the trick. There seems to be a problem with ArcGIS scanning the first 8 rows automatically, though. –  Stephen Lead Aug 1 '12 at 1:12
1  
I had to add "MaxScanRows = 0" since the "ColX=name Text" thing didn't seem to work 100% on its own. –  Stephen Lead Sep 3 '12 at 23:51
    
Has anyone tried this using arcpy on Linux? I'd guess that this would only work on Windows since schema.ini is all tied up with the Micrsoft ODBC cruft. –  Curtis Price May 1 '13 at 18:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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