I have a directory with 50 subdirectories containing a total of 300 shapefiles which I would like to query for their feature count and output to a text file.
Thus far I am able to get the feature count for all shapefiles in 1 subdirectory using ogrinfo:
for %f in (*.shp) do ogrinfo -al -so %f
This outputs a lot of additional metadata and tags which need to be stripped out manually.
Introducing the following to this script results in the feature counts all equaling 1:
-dialect sqlite -sql "SELECT COUNT(DISTINCT('ID'))"
I'd love to learn a command line solution to efficiently parse the ogrinfo output. I recognize that this could require some awk/grep type solutions which I can learn to do, but I am working with a standard Windows 10 install of OSGEO /GDAL.