Last Updated: February 25, 2016
·
1.043K
· janzong701

dos-batch-remove-characters-from-string-in-a-for-loop

@echo off </br>
setlocal enabledelayedexpansion </br>
for /f "delims=" %%a in (file.txt) do ( </br>
    set str=%%a </br>
    set str=!str: =! </br>
    set str=!str:"=! </br>
    echo !str! </br>
)

@echo off </br>
setlocal enabledelayedexpansion </br>
(for /f "delims=" %%a in (file.txt) do ( </br>
    set str=%%a </br>
    set str=!str: =! </br>
    set str=!str:"=! </br>
    echo !str! </br>
)) >output.txt </br>