Sign in to follow this  
Followers 0
MazeMiami

parsing data

8 posts in this topic

I been browsing the forums continuously looking for the best method to parse a string of data

i want to paste this peace to data from my web site into two different inputs

Example:

123456:9090

ip: 123456

port: 9090

you can find the site here

http://adllure.com/test.html

I would highly appreciate if someone can show me an example of this

thank you in advance

Share this post


Link to post
Share on other sites



StringSplit would seem to be the easiest option. :)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

StringSplit would seem to be the easiest option. :)

yea but i just dont get it lol

#Include <String.au3>

IP = _StringSplit ("123456:9090", ":" )

msg(,"test", $IP )

nothing ;(

Edited by MazeMiami

Share this post


Link to post
Share on other sites

yea but i just dont get it lol

#Include <String.au3>

IP = _StringSplit ("123456:9090", ":" )

msg(,"test", $IP )

nothing ;(

Read the manual about the StringSplit() and arrays.

$sIP= "123456:9090"
$aIP = StringSplit ($sIP, ":" )
MsgBox(0,$aIP[1], $aIP[2] )

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

#include <INet.au3>
#include <String.au3>
#include <array.au3>
$File =_INetGetSource("http://adllure.com/test.html")
$Array = _StringBetween($File, "<body>", "</body>")
$IP = StringSlpit($Array,":")
GuiCtrlSetData($Input1, $IP[1])
GuiCtrlSetData($Input2, $IP[2])

Edited by billthecreator

[font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Yep that worked perfect and helped me do a lot of diffrent thing with my code :)

Thanks a TON!!

now i would like to codee a script that can add an ip to a .txt and then check for duplicate if duplicate then exit,

right now my code can just look up the current ip and if same exit

$oIE = _IECreate  ("http://doamin/getip.php") 
$Dup =_IEBodyReadText($oIE)

if $Dup = $IP Then Exit

any idea what best practices would be for this

Edited by MazeMiami

Share this post


Link to post
Share on other sites

im guessing you want this:

#include <INet.au3>
#include <String.au3>
#include <array.au3>
$IpFile = "IPfile.ini"
$GetIp = IniRead($IpFile, "IP", "Value", "")

$File =_INetGetSource("http://adllure.com/test.html")
$Array = _StringBetween($File, "<body>", "</body>")
$IP = StringSlpit($Array,":")

If $IP[1] = $GetIp Then Exit
IniWrite($IpFile, "IP", "Value", $IP[1])

[font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap

Share this post


Link to post
Share on other sites

im guessing you want this:

#include <INet.au3>
#include <String.au3>
#include <array.au3>
$IpFile = "IPfile.ini"
$GetIp = IniRead($IpFile, "IP", "Value", "")

$File =_INetGetSource("http://adllure.com/test.html")
$Array = _StringBetween($File, "<body>", "</body>")
$IP = StringSlpit($Array,":")

If $IP[1] = $GetIp Then Exit
IniWrite($IpFile, "IP", "Value", $IP[1])

Just played with this but it doesn't seem to be writing the proxy to the .ini file

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