I imported a text table (.csv) that has mostly integer values. One of the columns has decimal values and zeros. The zeros show up, but the decimal values are turning up as <NULL>. I don't know why or how to fix this. An example of the original values is follows:
0 |
0 |
0.0015875253 |
0 |
0 |
0 |
0.0015985837 |
0.0008001244 |
0 |
0.0002734285 |
Can someone tell me how to get the decimal values to remain instead of them turning to NULL?
Solved! Go to Solution.
I think the issue is that when ArcGIS attempts to determine the field type it only looks at the first value and assumes the field should be an integer (Long).
If you change your first value in the column from 0 to 0.0, ArcGIS will assume the field is a double value:
Some questions to help troubleshoot:
1. Which software are you using to do the import process? For example, are you using a Tool or instead "Add Data" in ArcMap. Also, what version is the software?
2. What are you importing it into? Right into ArcMap and viewing it there, still as a .csv? Into a geodatabase? Or creating some other new file?
Chris Donohue, GISP
I used "Add Data". I'm using ArcMap 10.2.1.
It's still a .csv as a standalone file. Did not import to a geodatabase or any other files.
Can you share the csv file as an attachment, if it's not to large.
I tried the direct "Add Data" approach result and got the same less-than-desirable results you got. Luckily, there are several other ways to get the data in.
Excel might be a way to go, if you have access to it. I brought it in to Excel 2010 fine via "File, Open" (I made a csv first from your sample posted above). While in Excel, the field was changed from "General" to "Number", and then the file saved as an .xls. It then worked to bring it into ArcMap via "Add Data".
Related note - you may have to change the display characteristics of the table in ArcMap to see all the significant digits, as it defaults to less characters than you have in your data. To do that, right-click on the Fieldname in the table (in my case, "Value"), then choose "Properties". Then click on the "Numeric" elipsis button ... to get the Number Format window. Increase the "Number of significant digits" to match what is needed for your data.
Chris Donohue, GISP
I think the issue is that when ArcGIS attempts to determine the field type it only looks at the first value and assumes the field should be an integer (Long).
If you change your first value in the column from 0 to 0.0, ArcGIS will assume the field is a double value:
Thanks for all of the help. Per Owen's suggestion, I changed the first value to "0.00000001" and then the .csv worked. I realize that's pretty close to 0, but in order to remain consistent, I changed back to 0 and used .xls, as Chris suggested and that worked.