Jump to content
Sign in to follow this  
cwem

Parse html result into an excel file

Recommended Posts

cwem

Searching Google, I find that autoit provides convenient way to write in excel file:

;Provides the SF Link in the GUI Viewer

.cells ($i_viewer, $j_viewer + 3) = $objRecordSet.Fields (8).value

But my HTML result is presented in the following way, not in a table format :D

Is there convenient way to transform the lines into rows in Excel or I have to parse one by one?

<pre><font >Identifier Position Mismatches Score Factor (Pattern)

<A HREF="http://111.111.111.111/start.cgi?ac=1233" target="_blank">HS$</a> 331 (-) 0 100.00 <A HREF="http://111.111.111.111/start.cgi?ac=T005" target="_blank">-kap </a> ABCDE

<A HREF="http://111.111.111.111/start.cgi?ac=R01" target="_blank">GRO2_01</a> 331 (-) 0 100.00 <A HREF="http://111.111.111.111/start.cgi?ac=T005" target="_blank">-kap </a> GAXY

...

many other lines follow in a similar way

...

</font></pre>

Share this post


Link to post
Share on other sites
Skruge

Given the HTML you posted, what would the table look like?

For example, in CSV...

"HS$"," 331 (-) 0 100.00 ","-kap "," ABCDE"

"GRO2_01"," 331 (-) 0 100.00 ","-kap "," GAXY"

There are plenty of String functions you can use to format it the way you need, StringRegExp being the most powerful.


[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Share this post


Link to post
Share on other sites
cwem

Given the HTML you posted, what would the table look like?

For example, in CSV...

"HS$"," 331 (-) 0 100.00 ","-kap "," ABCDE"

"GRO2_01"," 331 (-) 0 100.00 ","-kap "," GAXY"

There are plenty of String functions you can use to format it the way you need, StringRegExp being the most powerful.

The "pseudotable" cells are separated by @TAB, and the whole "table" is delimited by <PRE> </PRE>

while I can use _IETagNameGetCollection to <PRE>, I'm unable to get the contents inside in a systematic way...

On the other hand, StringRegExp seems to be unable to process multiple lines...

Share this post


Link to post
Share on other sites
Malkey

Searching Google, I find that autoit provides convenient way to write in excel file:

;Provides the SF Link in the GUI Viewer

.cells ($i_viewer, $j_viewer + 3) = $objRecordSet.Fields (8).value

But my HTML result is presented in the following way, not in a table format :(

Is there convenient way to transform the lines into rows in Excel or I have to parse one by one?

<pre><font >Identifier Position Mismatches Score Factor (Pattern)

<A HREF="http://111.111.111.111/start.cgi?ac=1233" target="_blank">HS{:content:}lt;/a> 331 (-) 0 100.00 <A HREF="http://111.111.111.111/start.cgi?ac=T005" target="_blank">-kap </a> ABCDE

<A HREF="http://111.111.111.111/start.cgi?ac=R01" target="_blank">GRO2_01</a> 331 (-) 0 100.00 <A HREF="http://111.111.111.111/start.cgi?ac=T005" target="_blank">-kap </a> GAXY

...

many other lines follow in a similar way

...

</font></pre>

From the html code in post #1, just curious as to what your intended objective will look like in an Excel worksheet:-

Rows            Columns
          A B   C   D
1       ?   ?   ?   ?
2       ?   ?   ?   ?
Where, ? = cell content (of Excel worksheet.)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×