<div dir="ltr"><div><div><div><div>I've cross-posted this to <a href="http://gis.stackexchange.com/questions/72620/how-to-specify-fields-to-export-from-qgis">http://gis.stackexchange.com/questions/72620/how-to-specify-fields-to-export-from-qgis</a> so you can get more details if so inclined.<br>

<br></div>My basic question is this:  Is there a way to specify which fields to export to a spatial layer (ie- shapefile) when you right-click the layer and choose "Save As"?<br><br></div>I would have expected hidden fields would not export, but that is not the case.  I tried putting code in the "Layer" box of the "Save As" dialog with no success.  I simply cannot figure out a way to include only a select group of fields to my output layer.<br>

<br></div>My sample (command line) ogr2ogr code that does work is:<br>ogr2ogr -f "ESRI Shapefile" test.shp city.shp -sql "select name from city"<br><br></div>but using any combination (that I can think of) of the SQL flag in the QGIS Layer box has had no effect.  How can I get around this issue without deleting the fields manually after export?<br>

</div>