content file.txt
AAA;123;datiABCdati;querty;z
BBB;456;datiAAAdati;querty;z
content test.bat
Code: Select all
FOR /F "tokens=1 delims=." %%a IN ("%~nx1") DO FOR /F "tokens=1,2,3,4,5 delims=;" %%b IN ('FINDSTR %%a file.txt') DO (
SET A=%%b
SET B=%%c
SET C=%%d
SET D=%%e
SET E=%%f
)
CALL test.bat AAA.BBB.CCC
result:
BBB 456 datiAAAdati querty z
I like to search AAA for the 1 data before semicolon
Why the 2 row and not the First?
I aspect this row
AAA;123;datiABCdati;querty;z
(tokens=1 delims=.)
Regards
Dario