Computing.Net > Forums > Programming > Batch problem make < literal

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch problem make < literal

Reply to Message Icon

Name: TCCJohn
Date: June 17, 2008 at 23:18:30 Pacific
OS: XP
CPU/Ram: P4/2048
Product: Asus
Comment:

I am having a problem on a batch file that was created to strip html tags from a text file.

Everything is being stripped using the for /f and setting string variables.

what I cannot seem to find is a way to declare the < or > character as a literal. Instead they are being interpreted as redirects. Anyone know a way around this?
A sample peice of the code is below:
set str=!str:html=!
set str=!str:body=!
set str=!str:head=!
set str=!str:title=!
set str=!str:/=!
set str=!str:<=! ::this one is the problem

John @ TCC



Sponsored Link
Ads by Google

Response Number 1
Name: IVO
Date: June 18, 2008 at 03:13:11 Pacific
Reply:

You have to prefix special symbols as redirectors with the caret ^ to let them be interpreted as plain characters, so

set str=!str:^<=!


0

Response Number 2
Name: TCCJohn
Date: June 18, 2008 at 09:39:22 Pacific
Reply:

THANK YOU IVO!! :) IT WORKED PERFECT!!

But you knew that already.

I could not find any info anywhere on this. Even dug out my old DOS bible.

Thanks again and hope anyone else with similar issues finds this forum.

John @ TCC


0

Response Number 3
Name: Razor2.3
Date: June 18, 2008 at 11:33:01 Pacific
Reply:

I could not find any info anywhere on this. Even dug out my old DOS bible.
NT Command Script != DOS


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Batch problem make < literal

Batch Problem www.computing.net/answers/programming/batch-problem/18387.html

batch file make .reg www.computing.net/answers/programming/batch-file-make-reg/11739.html

batch problem www.computing.net/answers/programming/batch-problem-/11835.html