MS-DOS

Moderators: blip
Number of threads: 362
Number of posts: 872

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
DOS cammand can't re-assign variable in a text file Posted by Curious52 on 4 Mar 2013 at 7:42 AM
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



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.