Jump to content
Sign in to follow this  
epo

read line until ':' sign

Recommended Posts

epo

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.

Share this post


Link to post
Share on other sites
Jos

Something like this should do it:

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

Jos ;)


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
komalo

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]

Share this post


Link to post
Share on other sites
epo

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

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.