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.

So I am importing a csv file to ArcGIS and it has a bunch of alphanumeric values..

e.g. Attribute ID contains values such as 101, 101A, 101B etc ...the problem is when i am importing the csv to ArcGIS it is putting values wherever alphanumeric signs exist

Can anyone suggest a way to overcome this ?

share|improve this question
2  
Do you have an example of what it is doing? This should be imported as a text string. –  Dan Patterson Feb 16 '12 at 19:03
    
It is just giving me <NULL> values wherever alphanumeric values exist –  GeoH2O Feb 16 '12 at 19:23
    
Is this problem just for the headers? ArcMap often protests having field names starting with numbers. Can you prefix them? –  ako Feb 17 '12 at 0:14

3 Answers 3

up vote 6 down vote accepted

I created the following data.csv file:

AttributeID
101
101A
101B

Then I imported the data using the Table to Table tool:

  1. Open ArcMap
  2. Expand Catalog window
  3. Located data.csv
  4. Right click and select Export > To Geodatabase (single)...
  5. Specified Output Location to be my Geodatabase (I'm using SDE on SQL Server)
  6. Specified Output Table
  7. Note that the field map has AttributeID set to Text
  8. Click Ok

After the data is imported it's added to your Table of Contents (under sources). When I check the AttributeID column the values are imported correctly.

share|improve this answer
    
This works fine !! thank you –  GeoH2O Feb 17 '12 at 1:01

My guess is if the first value in a given column of the CSV file looks like an integer, the resulting field will be of type LONG and any subsequent value that's not an integer is invalid. I'd suggest using the Python csv module to read the file in and spit it back out with the Excel "dialect" that ArcGIS prefers.

share|improve this answer
1  
When ESRI switched from ArcView 3.X about 10 years ago, this became a problem. They used a Microsoft library read 10 lines of the file and then guess the data types of each field. MS used the same library for Excel. I saw files ruined because long numbers were turned into scientific notation. There was a way to use a hidden file to tell MS how to interpret the fields. The problem was that if you didn't know about the hidden file you wouldn't know to copy it every time you moved the file. I had to write special scripts for ESRI and Excel to make sure specific fields weren't corrupted. –  mhoran_psprep Feb 17 '12 at 1:11
    
I have noticed this as well when you export to text from ArcGIS -- more info about this file, called schema.ini available here: msdn.microsoft.com/en-us/library/windows/desktop/… –  blah238 Feb 17 '12 at 1:14
    
schema.ini is also documented in the ESRI help here: help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//… –  blah238 Feb 17 '12 at 1:17

I think there is a bug in the Import Table tool because even when you explicitly specify that you want the supposedly numeric field to be text (right-click the field in the import tool window and go to Properties), it still imports the alphanumeric values as Null. As a workaround, you can put quotes around the first value for that column in the csv file. You have to remove the quotes again from the imported table, but it does seem to accept the alpha values that way.

share|improve this answer
    
Hmm...this is a workaround..but this is a serious issue for me –  GeoH2O Feb 16 '12 at 20:15
    
I've run into the same thing, and Kevin's suggestion is how I take care of it. Usually, I process the data first to put the entire column in quotes. When it is imported as text, the quotes go bye-bye. –  Nathanus Feb 16 '12 at 21:58

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.