I am fairly new to using batch files asides from the basics. I am trying to see if it is possible to run through 2 different loops at the same time to get my exports in ogr2ogr (postresql to geopackage, geojson etc).
I have no issues figuring out 1 loop.
For %%x IN (a,b,c) DO ogr2ogr -f "gpkg" C:\results\%%x_1.gpkg PG:"host=localhost
user=user1 dbname=testdb password=admin" -sql "SELECT * FROM %%x WHERE columnx = '1'"
I am trying to figure out if I can get another loop in where I can cycle through columnx from my select query. ie (1,2,3). So my example above it could generate 9 geopackages a_1,a_2,a_3,b_1,b_2,b_3,c_1,c_2,c_3.
Possibly something like this but of course it doesnt work.
For %%x IN (a,b,c) & FOR %%y IN (1,2,3) DO ogr2ogr -f "gpkg" C:\results\%%x_1.gpkg
PG:"host=localhost user=user1 dbname=testdb password=admin" -sql "SELECT *
FROM %%x WHERE columnx = '%%y'"
Not sure if it is possible or not? Any suggestion would be great.