Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

opening an HTML-file in procomm

Status
Not open for further replies.

gambino

Technical User
Oct 1, 2002
11
DE
hello everyone,
can someone help me with a problem.
i want to open an HTML-file in procomm.
i know how to open textfiles in procomm, but i have troubles with opening HTML-files??
can someone give me an example of how to open an HTML-file an search for words in the HTML-file??

what i want to accomplish is to open an HTML-file search for a word in it and then the 2 lines that are under it display in a dialogbox......

thx
gambino
 
Opening the HTML file should not be a problem. What you are trying to do may be tricky because the HTML file is not formatted like a regular file. The text you are looking for is not actually "under" the trigger text like in an ASCII file.

Here's and example. Save the first file as "test.html" in your Program Files/Aspect/ directory.
Code:
<HTML>
<HEAD>
<TITLE>Test</TITLE>
</HEAD>
<BODY>

<FONT SIZE=2><P>Test</P>

<P> </P>
<P>Find this</P>
<P>Display This</P>
<P>And This</P>
</FONT></BODY>
</HTML>

Now compile and run this script:
Code:
Proc Main
String LINE1
Fopen 0 &quot;test.html&quot; read text
While not feof 0
  Fgets 0 LINE1
  Usermsg LINE1
Endwhile
Endproc

If you scan through your real html file the same way, you may be able to find a preceding html tag that will allow you to always locate the data you want to display. This is also dependent on how consistent the publisher is in coding the html. They may have <p> one day and <br><br> the next and on the screen it will look the same. Robert Harris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top