How to replace special characters...
Posted: 28 Jun 2010 07:16
Hi all,
let's say we have a file tmp.tmp with the following records (there are some blanks (spaces) infront of the <a title):
This file contains some lines as above with somefiles1.jpg ranging from somefile1.jpg ...somefile'n'.jpg
Question:
How can we easily replace/remove special characters (", <, >) from this file?
This is close to what I need but not 100% what I need. Just run it and you will see what I mean.
Please help.
Saso
let's say we have a file tmp.tmp with the following records (there are some blanks (spaces) infront of the <a title):
Code: Select all
<a title="some text" href="http://some.site.com/somefile1.jpg" target="_blank">somefile1.jpg</a>
This file contains some lines as above with somefiles1.jpg ranging from somefile1.jpg ...somefile'n'.jpg
Question:
How can we easily replace/remove special characters (", <, >) from this file?
Code: Select all
@echo off
setlocal ENABLEDELAYEDEXPANSION
for /f "tokens=1* delims=" %%a in (tmp.tmp) do set par1=%%a&& set par1=!par1:^<=!&& set par1=!par1:^>=! set par1=!par1:^"=!&&echo XX!par1!XX
goto :EOF
This is close to what I need but not 100% what I need. Just run it and you will see what I mean.
Please help.
Saso