search and replace special charatcters

August 18, 2009 at 13:57:31
Specs: Windows XP
New to here....thanks for the help I've found up to now.....

I'm using batch file to parse an xml file to replace certain text strings, but 2 problems I am having....

1 - While in the For /f loop processing lines, if I try to make any conditional statement at all, it halts and closes the batch file.

2 - If I try to use a variable (whether %var%, or !var!....that contains < or >, I can't get them to read as text..they always try to redirect.


See More: search and replace special charatcters

Report •


#1
August 18, 2009 at 14:21:17
About the first question you can freely code conditional IF statements inside a For /F loop BUT you can't code GOTO that refers to a label inside the loop itself. In other words you have to strictly follow the rules of structured (gotoless) programming.

The second question is a big issue and there is no general rule to handle it, any case must be examined carefully.

Last but not least the questions you posted are better suited for the Programming Forum.


Report •

#2
August 18, 2009 at 20:24:37
Thanks for the response.....

Report •

#3
August 19, 2009 at 01:54:07
With all due respect IVO you should really direct programming questions to the proper forum. There was considerable talk about this in the Lounge some time back.

http://ewen.uuuq.com/


Report •

Related Solutions

#4
August 19, 2009 at 03:30:00
@Ewen

my way is first to give aid then redirect to the right Forum. Batch scripting issues belong to the twilight zone between system and programming and I feel they are hated by most part of regulars, I don't know why.

About The Lounge that is a nice place but too biased to US way of life: I live in Europe and can assure there is life outside US and looks quite different (no little green men however).


Report •

#5
August 19, 2009 at 13:34:10
Thanks for your suggestion and re-direction...like I said , I am new.

Solved my issues with carefully placed ^'s and " 's

Thanks again.


Report •


Ask Question