I have a batch file that reads a text file and displays certain
strings back using the 'findstr' command. Some strings that the batch
returns contain HTML code. The string looks something like this:

Important text1: <A HREF="/cgi-bin/blah/blah>Important text2</A>

I was wondering if there is a way to create a vbs file to remove the
HTML code from the text file. Any help will be appreciated ;)


-ghettocow

RE: edit text entries... by tlavedas

tlavedas
Mon Aug 16 08:07:01 CDT 2004

Here's one way I can think of ...

sPathSpec = "somefileNmae.ext"
With CreateObject("Scripting.FileSystemObject")
if .FileExists(sPathSpec) Then
sUrl = .Getfile(sPathspec).Path
Else
wsh.echo "File not found."
wsh.Quit
End if
End With
wsh.echo sURL
with CreateObject("InternetExplorer.Application")
.Navigate("file://" & sURL)
Do until .ReadyState = 4 : WScript.Sleep 100 : Loop
s = .document.body.innerText
End With ' IE
wsh.echo s

Tom Lavedas
===========

"ghettocow" wrote:

> I have a batch file that reads a text file and displays certain
> strings back using the 'findstr' command. Some strings that the batch
> returns contain HTML code. The string looks something like this:
>
> Important text1: <A HREF="/cgi-bin/blah/blah>Important text2</A>
>
> I was wondering if there is a way to create a vbs file to remove the
> HTML code from the text file. Any help will be appreciated ;)
>
>
> -ghettocow

Re: edit text entries... by Jerold

Jerold
Mon Aug 16 12:27:54 CDT 2004

On 15 Aug 2004 21:49:47 -0700, ghettocow@hotmail.com (ghettocow) wrote:

>I have a batch file that reads a text file and displays certain
>strings back using the 'findstr' command. Some strings that the batch
>returns contain HTML code. The string looks something like this:
>
>Important text1: <A HREF="/cgi-bin/blah/blah>Important text2</A>
>
>I was wondering if there is a way to create a vbs file to remove the
>HTML code from the text file. Any help will be appreciated ;)
>
>
> -ghettocow


See http://www.jsiinc.com/SUBQ/tip8300/rh8385.htm
How can a batch job process files that contain command control characters?



Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com