I am attempting to mass-convert a large number of GRIB files to netCDF using grib tools (I am on Windows 7) in a batch file.
I am using this code:
for /f %%f in (`dir /b O:\Praksa\incadata\2014\01\01`)
do
echo %%f grib_to_netcdf -D NC_FLOAT -o *.nc *.grb
But when I run it nothing seems to happen except for CMD opening and closing really fast.
There is probably some syntax error I missed in there, but my main question is: Can I use wildcards (*) in grib tools statements? Also, are spaces in directory pathnames problematic?
Thanks!
You got the syntax wrong.
cmd
is very picky about syntax. Try this:%%~fA
gives you the full qualified filename,%~dpnA
the Drive, Path and Name only. Seefor /?
for those modifiers.dir /a-d
excludes foldernames. Seedir /?
for more info.