Friday, 3 August 2018

Forcing ArcMap to Ignore Double Quotation Mark In CSV Text Field When Exporting to Shapefile?


In ArcMap 10.2 I'm following this workflow:



  1. Add .csv to map.

  2. Right click .csv, --> "Display XY Data"

  3. Right click XY Event Layer, --> "Data" --> "Export Data" --> save it as a shapefile.


There are 1232 rows in my .csv but the resulting shapefile has only the first 235 rows. The last row in my new shapefile (row 235) has one double quotation mark (") in the fifth (text) column.


This screen grab shows how the double quotation mark should appear in its cell.


enter image description here



This screen grab shows the result of bringing that row into a shapefile in ArcMap. Notice the quotation mark is absent but the lat, lon and subsequent field values appear in the same text cell, while the subsequent lat, lon, and so on fields are empty.


enter image description here


I found out that you can escape a double quotation mark by adding a second right after it, like this... (""), so I made this change manually in Excel. This was the solution. Next time I followed the above workflow I had all 1232 rows in my new shapefile.


How can I achieve this escaping of the double quotation mark in ArcMap rather than doing it manually in Excel?


A related side problem: Although setting the " manually to a "" in Excel allows all 1232 rows to be converted in ArcMap, the cell in question in the resulting shapefile has "" instead of where it should only have ". It look like this:


enter image description here




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...