Sign in to follow this  
Followers 0
Bastard75

Parse strings into a list

4 posts in this topic

Hi,

This is my 1st post, but I have spent a 2days on searching and reading this forum. I found many usefull informations about AutoIt, but still have some problems ;/

Let me explain my problem:

I want to parse a some portion of data that I grab from web page (ctrl+a, ctrl+c - so I have it in my clipboard)

The data contains informations like this (this is from Polish version of online game: OGame):

Events
0:32:58
21:22:47    Jedna z twoich flot z planety aaa [x:xxx:x] osiągnie planetę fff [x:xxx:x]. Misja: Transportuj
0:33:01
21:22:50    Jedna z twoich flot z planety bbb [x:xxx:x] osiągnie planetę fff [x:xxx:x]. Misja: Transportuj
0:35:54
21:25:44    Jedna z twoich flot z planety ccc [x:xxx:x] osiągnie planetę fff [x:xxx:x]. Misja: Transportuj
0:38:39
21:28:29    Jedna z twoich flot z planety ddd [x:xxx:x] osiągnie planetę fff [x:xxx:x]. Misja: Transportuj
1:19:24
22:09:14    Jedna z twoich flot z planety eee [x:xxx:x] osiągnie Księżyc [x:xxx:x]. Misja: Stacjonuj
1:49:03
22:38:53    Jedna z twoich flot wraca z planety fff [x:xxx:x] na planetę aaa [x:xxx:x]. Misja: Transportuj
1:50:23
22:40:13    Jedna z twoich flot wraca z planety fff [x:xxx:x] na planetę bbb [x:xxx:x]. Misja: Transportuj
1:55:46
22:45:36    Jedna z twoich flot wraca z planety fff [x:xxx:x] na planetę ccc [x:xxx:x]. Misja: Transportuj
1:58:31
22:48:21    Jedna z twoich flot wraca z planety fff [x:xxx:x] na planetę ddd [x:xxx:x]. Misja: Transportuj

First time means how many time left to event, second shows the exact time whne it will happen (hh:mm:ss). After this, there are informations about fleet that is going to any of my planets (4 fleets with Transport mission + 1 fleet with Stay on planet + 4 fleets with mission Transport that will return to their planet)

I want to parse this data into list like this:

Fleet from aaa will arrive to fff at: hh:mm:ss with mission: Transport

Fleet from bbb will arrive to fff at: hh:mm:ss with mission: Transport

Fleet from ccc will arrive to fff at: hh:mm:ss with mission: Transport

Fleet from ddd will arrive to fff at: hh:mm:ss with mission: Transport

Fleet from eee will arrive to fff at: hh:mm:ss with mission: Stay on planet

Other informations about returning fleets are useless...

Can someone help me with this problem?

Share this post


Link to post
Share on other sites



Download the latest Beta and look at _StringBetween() in the help file.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

I have latest beta installed on my hdd. Problem is that I don't know how to set the '$to' parameter in this case... @CR? @LF?

Do I need it in some kind of loop? If yes, how the cript will now when to stop?

Share this post


Link to post
Share on other sites

Well, Run the example, see what happens, then look at it line by line.


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

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