[gdal-dev] OGR SQL on CSV file with field name with parentheses?

Moskovitz, Bob@DOC Bob.Moskovitz at conservation.ca.gov
Fri Apr 19 09:05:14 PDT 2019


Thanks John, it worked perfectly!

From: John Baumgartner <johnbaums at gmail.com>
Sent: Thursday, April 18, 2019 9:52 PM
To: Moskovitz, Bob at DOC <Bob.Moskovitz at conservation.ca.gov>
Cc: gdal-dev at lists.osgeo.org
Subject: Re: [gdal-dev] OGR SQL on CSV file with field name with parentheses?

Try surrounding the field name with square brackets:

ogrinfo -al "Data_directory" -dialect sqlite -sql "SELECT [Vs30(m/s)] as Vs30 FROM file1"

On Fri, 19 Apr 2019 at 09:32, Moskovitz, Bob at DOC <Bob.Moskovitz at conservation.ca.gov<mailto:Bob.Moskovitz at conservation.ca.gov>> wrote:
Hello gdal_dev,

I am trying to use ogrinfo on a set of CSV file that has a field with the name “Vs30(m/s)”, but change the name to “Vs30”.  Is this possible or do I have to edit a bunch of files headers to do this?

I tried:
ogrinfo -al "Data_directory" -dialect sqlite -sql "SELECT Vs30(m/s) as Vs30 FROM file1"
but as expected ogrinfo gave the error message “no such function: Vs30”.

Thanks in advance!
_______________________________________________
gdal-dev mailing list
gdal-dev at lists.osgeo.org<mailto:gdal-dev at lists.osgeo.org>
https://lists.osgeo.org/mailman/listinfo/gdal-dev<https://gcc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fgdal-dev&data=02%7C01%7CBob.Moskovitz%40conservation.ca.gov%7Cbe37bd898b284d9b257e08d6c482d295%7C4c5988ae5a0040e8b065a017f9c99494%7C0%7C1%7C636912463499656682&sdata=OZJ%2FGfBXcYshyy6evRQFKlrGUBQEw3kNiT6%2BVWsX9Vk%3D&reserved=0>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20190419/8252c969/attachment-0001.html>


More information about the gdal-dev mailing list