在 windows 命令提示符中为多个 netcdf 文件执行循环

Performing a loop in windows command prompt for multiple netcdf files

我正在使用一个程序 (andx),它允许我通过 windows 命令提示符将 netcdf 文件中的数据提取到 .TXT 文件中。每个 ncdf 文件(总共 370 个)有 7 个变量(时间、atmos_pressure、temp_mean、rh_mean、wspd_vec_mean、wdir_vec_mean 和 org_precip_rate_mean)。

目前我可以使用每个单独的文件执行我想要的操作,方法是:

andx XXXXX.b1.20150401.cdf -o TXT atmos_pressure

这会将时间和变量 atmos_pressure 输出到 .txt 文件中。

我需要这样做,但对于我拥有的所有 370 个 .cdf 文件,我需要在提示中循环。我正在尝试遵循论坛其他方面的一些提示并在此处申请:

FOR %i IN (*.cdf) DO andx *.cdf -o TXT atmos_pressure temp_mean rh_mean wspd_vec_mean wdir_vec_mean org_precip_rate_mean

我可以看到它正在搜索每个文件,但我收到一条错误消息,提示未找到该变量。

在DO块中使用变量。

FOR %i IN (*.cdf) DO (andx "%~i" -o TXT atmos_pressure temp_mean rh_mean wspd_vec_mean wdir_vec_mean org_precip_rate_mean)