this batch really works well, but when in a row there's some "&" ampersand simbol, this is interpreted as a command and divide the outpur result in two line also I got this errors sometimes
Numero non valido. Le costanti numeriche sono decimali (17),
esadecimali (0x11) o ottali (021).
"sleep" non è riconosciuto come comando interno o esterno,
un programma eseguibile o un file batch.
Numero non valido. Le costanti numeriche sono decimali (17),
esadecimali (0x11) o ottali (021).
I try to use "%name%" and works fine, but I don't want "" in a new file
Any idea? Thanks in advance
Best
Code: Select all
@echo off &setlocal
pushd "E:\bat\Temp"
for /f "delims=" %%a in (fileinput.txt) do set "name=%%a"&call :procName
popd
goto :eof
:procName
if "%name:~2,2%"=="00" (
for /f "usebackq tokens=1,2 delims=;" %%a in ("%~dp0Table2.txt") do if "%name:~4,4%"=="%%a" (
set "newCode1=%%b"
for /f "usebackq tokens=1,2 delims=;" %%c in ("%~dp0Table1.txt") do if "%name:~0,2%"=="%%c" (
set "newCode2=%%d"
goto break_loop
)
)
)
:break_loop
>> "ADDRESS.%newCode1%.%newCode2%" ECHO %name%
goto :eof