I have this issue using findstr command
searching filename: invoices.txt and invoices.dett.txt inside file tabella.txt
in tabella.txt there's this information
invoices.fatt.txt;dest1;dest2;dest3
invoices.txt;dest1;dest2;dest3
Code: Select all
FOR %%i in (%ORIGINE_DATI%\*.*) DO CALL :ELABORA %%~nxi
:ELABORA
SET stringa=%1
FOR /F "tokens=1,2,3,4 delims=;" %%a IN ('FINDSTR %stringa:~,-8% %SCRIPTS%\Tabella.txt') DO (
IF NOT EXIST "%DEST_DATI%-%AA_DATE%\%%c\%%b" mkdir "%DEST_DATI%-%AA_DATE%\%%c\%%b"
IF "%%c" EQU "Dest2" MOVE /Y "%ORIGINE_DATI%\%1" "%DEST_DATI%-%AA_DATE%\%%c\%%b\%AA_DATE%-%MM_DATE% %1.%%d"
IF "%%c" EQU "Dest3" MOVE /Y "%ORIGINE_DATI%\%1" "%DEST_DATI%-%AA_DATE%\%%c\%%b\%AA_DATE% %1.%%d"
GOTO:EOF
)
name "invoices" is common, so this batch run twice, how can I solve this problem?
Regards