Jump to content

read line until ':' sign


epo
 Share

Recommended Posts

i want to read a few proxy line in file.txt but stop it before ':' symbol

111.222.333.444:8080

11.2.3.44:80

111.22.33.44:8181

so the result should be

111.222.333.444

11.2.3.44

111.22.33.44

i don't have a problem if the file look like this

111.222.333.444:8080

131.222.373.484:8080

141.252.353.494:8080

how to read in autoit? tqvm.

Link to comment
Share on other sites

  • Developers

Something like this should do it:

$result = StringSplit($record,":") 
$ipaddres = $result[1]

Jos ;)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

you can put them in iniFormat and use IniReadSection with StringSplit

[font="Palatino Linotype"][size="3"]AutoIt Script Examples :[/size][/font][font="Palatino Linotype"][size="3"]_CaptureBehindWindowGlass CMD for Windows Vista/Seven[/size][/font][left][/left][font="Palatino Linotype"][size="3"]Non AutoIt Script programs : Border Skin - Aero Glass On XP[/size][/font]
Link to comment
Share on other sites

tq all... mission accomplished...

While 1
    $line = FileReadLine($file)
    If @error = -1 Then ExitLoop
    $result = StringSplit($line, ":")
    $ipaddres = $result[1]
    MsgBox(0, "Line read:", $ipaddres)
Wend
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...