Jump to content

Parse html result into an excel file


Recommended Posts

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>

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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.)
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...