1

I'am using Windows cmd to calculate some variables. The command works fine:

gut adapt_gf -InFile sla1.nc -OutFile sla_grid1.nc

However, I have many sla values (sla1.nc,sla2, sla3, etc).

Is there a way (for loop) so that I don't have to type inn all sla values and also change the OutFile values (sla_grid1,sla_grid2,sla_grid3, etc) each time?

Tim

1 Answer 1

0
@echo off
setlocal enabledelayedexpansion

for %%f in (*.nc) do (
    set OUT=%%f
    @echo gut adapt_gf -InFile %%f -OutFile sla_grid!OUT:~3!
    gut adapt_gf -InFile %%f -OutFile sla_grid!OUT:~3!
)
endlocal

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .