Unfrog Posted September 30, 2009 Posted September 30, 2009 (edited) I'm writing a basic script as follows: #Include <File.au3> $FileFullPath = @ScriptDir & "\Test.txt" #Include <Array.au3> $FileOpen = FileOpen($FileFullPath, 0) If $FileOpen=-1 Then MsgBox(0, "Notice", "Cannot open file") Exit EndIf $i = 1 $FileCountLines = _FileCountLines($FileFullPath) Global $Array[1] Do $FileReadLine = FileReadLine($FileOpen, $i) $StringSplit = StringSplit($FileReadLine, ":") _ArrayAdd($Array, $StringSplit[1] & ":" & $StringSplit[2]) _ArrayAdd($Array, $StringSplit[3]) $i = $i + 1 Until $i = $FileCountLines + 1 _ArrayDisplay($Array, "Show Infor") With file test.txt is : C:\Program Files\Yahoo!\Messenger\YahooMessenger.exe:10000 C:\Chrome\chrome.exe:20000 D:\Games\e-Games\NewGAME\~Launcher.exe:15646 C:\Program Files\Muziic\Muziic.exe:1654321 I want to write a simple script , it will be run Applications in test.txt with the number is time out.But I don't know how . Sorry , I'm newbie Edited September 30, 2009 by Unfrog
PsaltyDS Posted September 30, 2009 Posted September 30, 2009 Well, as a start, this replaces what you have so far: #include <File.au3> #include <Array.au3> Global $FileFullPath = @ScriptDir & "\Test.txt" Global $Array _FileReadToArray($FileFullPath, $Array) _ArrayDisplay($Array, "Show Infor") Now you just loop through $Array and process each line as you wish. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now