Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- rem Verifica se il file di input esiste
- if not exist input.txt (
- echo Il file di input non esiste. Il file batch verrĂ chiuso.
- pause
- exit
- )
- rem Cerca la stringa da sostituire all'interno del file di input
- findstr "vecchia_stringa" input.txt > temp.txt
- rem Sostituisce la stringa trovata con la nuova stringa
- set /p sostituto=<temp.txt
- set sostituto=%sostituto:vecchia_stringa=nuova_stringa%
- rem Scrive il contenuto modificato in un nuovo file
- echo %sostituto% > output.txt
- echo Sostituzione completata.
- pause
Add Comment
Please, Sign In to add comment