Import CSV

3448
5
08-23-2017 02:43 PM
ChantelSloan1
New Contributor

I am adding a very simple .csv file to a new map. The file has two columns, which are private data so I can't add the file here. The first column is a list of census tract ID numbers, the second is a value associated with that census tract. When I try to add the file it gets corrupted in some way. If I bring the file in directly it changes everything (ID numbers and values) to zeroes. If I try to add a column of row numbers (thought that might help), it imports the row numbers, eliminates the ID numbers and shows the values column twice. This is such a simple task, I can't figure out what I could possibly be doing wrong. There are no spaces or special characters in the column names. It isn't using the correct column names, however. It just uses the name of the file as the column name. I'm new to Pro, but am a longtime user of ArcMap. What am I missing?

Tags (2)
0 Kudos
5 Replies
DanPatterson_Retired
MVP Emeritus

Ensure that the field names are short with no spaces

ensure that the fields contain the same data type... just because a number looks like a number, it may not be... confirm this in the originating software.

you have covered no blank rows, no missing entries (substitute some value like -9999 for numeric fields)

If that isn't working, bring the file into excel and confirm the above there, then use the excel to table tool

ps... one missing comma can screw everything up as well

shan_sarkar
Occasional Contributor III

Formatting a table in Microsoft Excel for use in ArcGIS—Help | ArcGIS Desktop 

Understanding how to use Microsoft Excel files in ArcGIS—Help | ArcGIS Desktop 

Try to save the csv as an excel and use Excel To Table—Help | ArcGIS Desktop. However, you will still have to make the appropriate changes required for arcgis.

FAQ: What are the reserved words for Esri's file geodatabase? ensure that the columns do no have any reserved keywords.

I hope this helps!

~Shan


~Shan
MelissaNorthey
Occasional Contributor

Thank you! Five years later and this is still kicking our behinds. I've gone round and round this morning with a CSV file that was sent to me to update data that I already had in our database, no matter how I saved it I was getting ArcGIS to read wrong field names, data, etc. when I imported.  Using the Excel to Table tool was the fix.

0 Kudos
ChantelSloan1
New Contributor

Thank you both! The tool worked. I'm still not sure why saving as a csv and importing didn't work, but am glad to know the import tool solves the problems. 

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

There is no singular standard for the CSV format, and different applications handle certain aspects of writing CSV data differently.  Esri has made assumptions about how CSV files will be formatted, and sometimes those assumptions don't link up with how another program exports the data.  I could help give a specific reason if you could upload the file after stripping it or sanitizing it.

0 Kudos