Trim spaces from right using multiple FOR command
Posted: 14 Apr 2010 02:28
hi, i have file 'temp3.txt' - on each row is one string - for example "some string " and i need trim spaces from the right using FOR command for each row.
i use piece of yours code, but i'm not able to finish it.
please help me...i'm going crazy
i use piece of yours code, but i'm not able to finish it.
please help me...i'm going crazy
Code: Select all
for /f "tokens=1 delims=" %%x in ('type temp3.txt') do (
for /l %%a in (1,1,31) do if "!%%x:~-1!"==" " set "%%x=!%%x:~0,-1!"
echo %%x >> temp4.txt
)