Sign in to follow this  
Followers 0
sunburn

Help with capturing Text characters into Array elements

2 posts in this topic

I've given this a good shot, but my research in the help file and forum is leaving me hanging. If someone could held with some ideas or direction, it would be greatly appreciated. Basically I want to capture some text that is found on a webpage to an array to be sorted later.

Here is a small part of the source code that would be captured:

Notice that there are up to 69 characters after the </A> on one line then only 50 on the other

Trip Rv Type Date Departure Arrival Hours XXX XXX XXX XXX XXX St Commts

<A HREF="/xvixps-xxxxxxxxxxxxx?11?24JAN08">S888</A> ASBY 24JAN 24JAN 1945 25JAN 0045 436 XXX

<A HREF="/xvixps-xxxxxxxxxxxxxtr?276?MEM?11?25JAN08"> 276</A> 25JAN 25JAN 0850 26JAN 0542 600 XXX M10

Ideally element #1 would be populated with info found on the 2nd line that I posted

1)S888 (which is a obviously linked)

2)ASBY

3)24JAN

4)24JAN 1945

5)25JAN 0045

6)0436

7)XXX

8)Blank

9)blank

10)blank

Ideally element #2 would be populated with info found on the 3nd line that I posted

1)276 (which is a obviously linked)

2)blank

3)25JAN

4)25JAN 0850

5)26JAN 0542

6)0600

7)XXX

8)Blank

9)m10

10)blank

This might be simple for some of you, so please throw out some ideas on how to capture the desired info.

Thanks

Share this post


Link to post
Share on other sites



Maybe... close

#include <array.au3>

Dim $List[3]

$List_1 = '<A HREF="/xvixps-xxxxxxxxxxxxx?11?24JAN08">S888</A> ASBY 24JAN 24JAN 1945 25JAN 0045 436 XXX' 
$List_2 = '<A HREF="/xvixps-xxxxxxxxxxxxxtr?276?MEM?11?25JAN08"> 276</A> 25JAN 25JAN 0850 26JAN 0542 600 XXX M10' 

For $x = 1 To UBound($List) - 1
    
    $temp_info = StringTrimLeft(Eval("List_" & $x), StringInStr(Eval("List_" & $x), ">"))
    $temp_info = StringReplace($temp_info, "</A>", "")
    $temp_info = StringSplit($temp_info, " ")
    
    _ArrayDisplay($temp_info)

Next

8)


NEWHeader1.png

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  
Followers 0