Quantcast
Viewing all articles
Browse latest Browse all 2703

DOS cammand can't re-assign variable in a text file

a) I am able to replace a charater in string as:

@echo off
set str=StationName:Palais Royal - Musée du Louvre
echo.%str%
set str=%str:é=e%
echo.%str%


b) I am aslo able to read a text file with the above mentioned line as:

@echo off

setlocal enabledelayedexpansion
for /f "delims=" %%i in (c:\Test1\Test_Characters.txt) do (
set str=%%i
echo !str!
)



- Howevey to combine a) and b) it failed:

@echo off

setlocal enabledelayedexpansion
for /f "delims=" %%i in (c:\Test1\Test_Characters.txt) do (
set str=%%i
set str=%str:é=e%
echo !str!
)



Can someone explain why & correct my codes?

Thanks in-advanced

Viewing all articles
Browse latest Browse all 2703

Trending Articles