António,<br><br>The field name 'desc' is one of the SQL keywords[1]. It needs to be quoted for OGR to process it. So the following command should work.<br><span style="font-family: courier new,monospace;">ogr2ogr -f "esri shapefile" -sql "SELECT ele, time AS t,
magvar,geoidheigh, name, cmt, 'desc', src FROM GPS_Project" new.shp
GPS_Project.shp</span><br><br>[1]: <a href="http://trac.osgeo.org/gdal/wiki/rfc28_sqlfunc#CompatabilityImplications">http://trac.osgeo.org/gdal/wiki/rfc28_sqlfunc#CompatabilityImplications</a><br><br><div class="gmail_quote">
2011/10/28 António Rocha <span dir="ltr"><<a href="mailto:antonio.rocha@deimos.com.pt">antonio.rocha@deimos.com.pt</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi Ralf<br>
Thanks for the feedback but it did not work.<br>
I tried:<br>
ogr2ogr -f "esri shapefile" -sql "SELECT ele, time AS t, magvar,geoidheigh, name, cmt, desc, src FROM GPS_Project" new.shp GPS_Project.shp<div class="im"><br>
And I got:<br>
ERROR 1: SQL Expression Parsing Error: syntax error<br>
<br></div>
Even I tried:<br>
ogr2ogr -f "esri shapefile" -sql "SELECT ele, magvar,geoidheigh, name, cmt, desc, src FROM GPS_Project" new.shp GPS_Project.shp<div class="im"><br>
And I got:<br>
ERROR 1: SQL Expression Parsing Error: syntax error<br></div>
Any other suggestion?<br>
Thanks<br>
Antonio<div class="im"><br>
<br>
<br>
Ralf Suhr wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
ogr2ogr -f "esri shapefile" -sql "SELECT ele, time AS t, magvar, geoidheigh, name, cmt, desc, src FROM GPS_Project" new.shp GPS_Project.shp<br>
<br>
Gr<br>
Ralf<br>
<br>
On Freitag 28 Oktober 2011 13:54:37 António Rocha wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
ogr2ogr -sql "SELECT [ele AS ele, time AS t, magvar AS magvar, geoidheigh AS geoidheigh, name AS name, cmt AS cmt, desc_ AS desc_, src AS src] FROM GPS_Project.shp", new.shp GPS_Project.shp<br>
<br>
</blockquote>
<br>
<br>
<br>
</blockquote>
<br>
<br>
<br></div><div class="im">
__________ Information from ESET NOD32 Antivirus, version of virus signature database 6582 (20111028) __________<br>
<br>
The message was checked by ESET NOD32 Antivirus.<br>
<br>
<a href="http://www.eset.com" target="_blank">http://www.eset.com</a><br>
<br>
<br></div><div><div></div><div class="h5">
______________________________<u></u>_________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/<u></u>mailman/listinfo/gdal-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Best regards,<br>Chaitanya kumar CH.<br><br>+91-9494447584<br>17.2416N 80.1426E<br>