iz2rpn

Untitled

Dec 28th, 2022 (edited)
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. @echo off
  2.  
  3. rem Verifica se il file di input esiste
  4. if not exist input.txt (
  5. echo Il file di input non esiste. Il file batch verrĂ  chiuso.
  6. pause
  7. exit
  8. )
  9.  
  10. rem Cerca la stringa da sostituire all'interno del file di input
  11. findstr "vecchia_stringa" input.txt > temp.txt
  12.  
  13. rem Sostituisce la stringa trovata con la nuova stringa
  14. set /p sostituto=<temp.txt
  15. set sostituto=%sostituto:vecchia_stringa=nuova_stringa%
  16.  
  17. rem Scrive il contenuto modificato in un nuovo file
  18. echo %sostituto% > output.txt
  19.  
  20. echo Sostituzione completata.
  21. pause
  22.  
Add Comment
Please, Sign In to add comment