View unanswered posts | View active topics It is currently 21 Dec 2014 00:49



Post new topic Reply to topic  [ 2 posts ] 
How can DOS substitute equal signs? 
Author Message

Joined: 05 Sep 2011 09:15
Posts: 114
Post How can DOS substitute equal signs?
Code:
For /F "tokens=*" %%B IN (test.txt) DO (
   SETLOCAL ENABLEDELAYEDEXPANSION
   SET t=is
   SET old=%%B
   SET new=!old:t=!
   ECHO !new!
   
   ENDLOCAL
)


Two questions.
First, can I store the target text ("is") in the variable t and put t within the !!variable? It seems not working.
Second, how can I substitute "=" the equal sign with something else?

I can't do this. There are two equal signs.
Code:
SET new=!old:==!


02 Mar 2012 10:34
Profile

Joined: 10 Feb 2012 02:20
Posts: 4501
Post Re: How can DOS substitute equal signs?
You can use SED or a search and replace script to replace "is" and "=" with other things.


02 Mar 2012 15:28
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 


Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot], Google [Bot], Yahoo [Bot] and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Forum style by Vjacheslav Trushkin for Free Forums/DivisionCore.