Jump to content

Recommended Posts

Posted

I need help with the StringSplit function, I read the help file about it but I just don't understand it. Here is what I am trying to do:

There is a text file with a few hundred proxies, one on each line. Some quick examples are:

169.132.70.58:8080

165.98.148.248:2301

163.17.161.254:80

162.39.225.78:8000

159.148.85.90:6588

151.8.7.15:80

148.244.150.58:80

148.244.150.57:80

147.231.100.130:80

I am trying to split off the port number from the rest of the IP, while saving both to a seperate variable. So for the first one:

$x = "169.132.70.58"

$y = "8080"

From there, I can do what I want with the two variables and my program will be finished

Any help is GREATLY appreciated! (especially if you can provide me a snippet of code doing what I need to be done, I can edit it to suit my own needs)

Posted (edited)

Might need debug:

#include <file.au3>
_FileReadToArray ( $sFilePath, $Array) 
Dim $Proxies[$Array[0] + 1][2]
$Proxies[0][0] = $Array[0]
$Proxies[0][1] = 0
For $Count = 1 To $Array[0]
     $Temp = StringSplit($Array[$count], ':')
     If UBound($Temp) <> 6 Then 
          $Proxies[0][0] = $Proxies[0][0] - 1
          ContinueLoop
     EndIf
     $Proxies[0][1] = $Proxies[0][1] + 1
     $Proxies[$Proxies[0][1]][0] = $Temp[1] & $Temp[2] & $Temp[3] & $Temp[4]
     $Proxies[$Proxies[0][1]][1] = $Temp[5]
Next

Edit: To explain this code, it takes given file (replace the $sFilePath up there) then it reads the proxies and blah blah. $Proxies[0][0/1] Are number of proxies, $Proxies[n > 0][0] = Ip address of nth line, $Proxies[n > 0][1] = Port of nth line

Edited by Wolvereness

Offering any help to anyone (to my capabilities of course)Want to say thanks? Click here! [quote name='Albert Einstein']Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.[/quote][quote name='Wolvereness' date='7:35PM Central, Jan 11, 2005']I'm NEVER wrong, I call it something else[/quote]

Posted

Always happy to help.

If you need something ASAP use my AIM = weswolf

Offering any help to anyone (to my capabilities of course)Want to say thanks? Click here! [quote name='Albert Einstein']Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.[/quote][quote name='Wolvereness' date='7:35PM Central, Jan 11, 2005']I'm NEVER wrong, I call it something else[/quote]

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
  • Recently Browsing   0 members

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