Tech Support Forum banner
Not open for further replies.
1 - 2 of 2 Posts

· Registered
1 Posts
Hi all,

I have a text file that has one line:
<td>50001~BUILD~09~TEST ONLY~Precision Dr, 3445 </td>
I'm looking to create a batch file to remove the <td> at the front of the line, and also remove  </td> at the end.

I've only been able to find stuff about search and replace, and I'm having a hard time understanding the code in these bigger batch files.

Any help would be appreciated. Thanks!

Ok, I think I got it. I used a bat file I found on a different forum that dealt with character deletion.

Then on another site I found out about left, right, mid and how to manipulate characters


@echo off > newfile & setLocal enableDELAYedexpansion

for /f "tokens=* delims= " %%a in (boolah.dat) do (
set str=%%a
set str=!str:~4,-12!
>> newfile echo !str!
This removes the first 4 characters ( <td> )
It also removes the last 12 characters (  </td> )
1 - 2 of 2 Posts
Not open for further replies.