On 10/09/2010 18:16, Upendra Dadi wrote:
Hi,
I have a query on creating shapefile from csv. I am not sure if this is
the correct forum for it. Thought I should try it anyway.
I have a csv file consisting of lat/lon and an attribute with double
quotes like this:
"<a
href="http://data.nodc.noaa.gov/thredds/dodsC/gtspp/atlantic/2010/07/9670278.nc.html";
target="_blank">Data URL</a>"

When I create the shape file from this file using a vrt file, the shape
file has this value for the attribute:
<a
href=http://data.nodc.noaa.gov/thredds/dodsC/gtspp/atlantic/2010/07/9670278.nc


As you can see, the double quotes are gone and the attribute is
truncated. How do I overcome this problem? Any help is appreciated.


I managed to fix the quote issue with: sed 's/"/"""/g'

The truncation issue comes from the shapefile driver's default width for string fields (80 characters). But one can create a .csvt file, as explained at: http://www.gdal.org/ogr/drv_csv.html

I copied some more details to here (for better readability): http://pastebin.com/6yeAzAZc

Hermann
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to