Select to view content in your preferred language

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

1636
5
12-16-2016 12:34 PM
ChristineButterfield
Deactivated User

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!

0 Kudos
5 Replies
JayantaPoddar
MVP Esteemed Contributor

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



Think Location
0 Kudos
ChristineButterfield
Deactivated User

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

0 Kudos
ChristineButterfield
Deactivated User

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

0 Kudos
DanPatterson_Retired
MVP Emeritus

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

JayantaPoddar
MVP Esteemed 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.



Think Location