Values changed to 0 or 1 when converting from .csv to .shp

614
5
12-16-2016 12:34 PM
Highlighted
New Contributor II

Hi everyone! I am converting a series of large datasets (>60,000 rows) from .csv to .shp files. These are files with quantified LiDAR metrics. However, when I convert these files from .csv to .shp, I've noticed that several of the values go missing (changed to either 0 or 1) in the attribute table. Is there a work-around for this? I attached screenshots of both tables to show what's happening. Thank you in advance for your help!

Reply
0 Kudos
5 Replies
Highlighted
Honored Contributor

Could you attach a sample of the CSV data? This help us to better analyse the issue.

Reply
0 Kudos
Highlighted
New Contributor II

I added a 40-row sample to the original post.

Reply
0 Kudos
Highlighted
New Contributor II

It seems like it was changing my data because of the column names, which had numbers in them. *sigh*

Reply
0 Kudos
Highlighted
MVP Esteemed Contributor

good  guess is that the fields are being read as an integer type because of the first row.  Fix the format of the csv so that the data type is obviously floating point ie 0.0000.  If the csv is originating from some piece of software, format the columns explicitly with the desired number of decimal points to ensure proper numeric conversion.  Data are generally not upcast to a higher level

Highlighted
Honored Contributor

Thank you Christine,

Here is what you need to do

EDIT: Copy the 3rd row of values to 1st row as mentioned by Dan_Patterson‌. Then follow these steps.

1. Open the CSV file on ArcMap (Drag from Arccatalog, drop on Table of Contents of ArcMap)

2. Right-click CSV file > Display XY Data.

3. The resulting Event layer will now consider the Fields as DOUBLE (and not LONG as earlier).

4. Export the Event Layer to Shapefile. A snapshot of the attribute table is shown below.