|Here's the best I could approximate your approach without jumping through hoops:|
@echo off & setlocal
set /p x=input:
for %%a in (%map%) do (
call :f %%a
if defined trans goto :display
for /f "tokens=1,2 delims=," %%b in (%1) do (
if /i "%%b" neq "%x%" goto :eof
echo ***translated: "%trans%"
::===== end batch
As you mentioned, there are a number of solutions. This is a simple association table: if input is A, output B, if input is X, output Y, etc.
ps: set /? covers some of "enabledelayedexpansion"