Reputation: 6010
I'm look to run an if statement in a for loop but am having issues. It should look something like this:
for %%a in (*.po) do (
echo ' Translating %%a'
if %%~na !='filename' msgfmt -cv -o %%~na.mo %%a
if %%~na !='filename' del %%a
)
But I'm seeing my filename.po converted and deleted still. What am I doing wrong. Do you see an error in my syntax?
Upvotes: 0
Views: 721
Reputation: 41234
This could help:
for %%a in (*.po) do (
echo ' Translating %%a'
if /i not "%%~na"=="filename" (
msgfmt -cv -o "%%~na.mo" "%%a"
del "%%a"
)
)
Upvotes: 1