sambalec Posted April 13, 2009 Share Posted April 13, 2009 (edited) Hello, I have a Text file ( file.txt) with website urls. What is the command to search if it exist an url in this text file ? Another question, is it possible to list in a Gui window the lines of this txt in a Select (option) to select url and remove url from file... Thank's a lot ! Edited April 13, 2009 by sambalec Link to comment Share on other sites More sharing options...
Developers Jos Posted April 13, 2009 Developers Share Posted April 13, 2009 (edited) What have you tried yourself and didn't work? (.. and you still ow me an answer about your previous thread) Jos Edited April 13, 2009 by 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 More sharing options...
sambalec Posted April 13, 2009 Author Share Posted April 13, 2009 i don't find good commands in helpfile... Link to comment Share on other sites More sharing options...
Developers Jos Posted April 13, 2009 Developers Share Posted April 13, 2009 (edited) i don't find good commands in helpfile...You could not find a command to read a file?.. and you forgot to comment on the second part in my post. Edited April 13, 2009 by 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 More sharing options...
sambalec Posted April 13, 2009 Author Share Posted April 13, 2009 (edited) I tried to use fileread, but how to list lines in GUI windows ? and how to delete a line through the GUI CODE$file = FileOpen("test.txt", 0) ; Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; Read in lines of text until the EOF is reached While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop MsgBox(0, "Line read:", $line) Wend FileClose($file) Edited April 13, 2009 by sambalec Link to comment Share on other sites More sharing options...
Cynagen Posted April 13, 2009 Share Posted April 13, 2009 Hello, I have a Text file ( file.txt) with website urls. What is the command to search if it exist an url in this text file ? Another question, is it possible to list in a Gui window the lines of this txt in a Select (option) to select url and remove url from file... Thank's a lot ! Fastest way I can think of: #include <Array.au3> $fHandle = FileOpen("file.txt",0) $fContents = FileRead($fHandle) $fLines = StringSplit($fContents,chr(10)) ;Following portion taken from the _ArraySearch help page. $Input = InputBox("Search", "URL?") If @error Then Exit $Pos = _ArraySearch ($fLines, $Input, 0, 0, 0, True) Select Case $Pos = -1 MsgBox(0, "Not Found", '"' & $Input & '" was not found in the array.') Case Else MsgBox(0, "Found", '"' & $Input & '" was found in the array at pos ' & $Pos & ".") EndSelect FileClose($fHandle) Blah, blah, blah... lip service... lip service.Working on a number of projects right now, just waiting for my time to post them here on AutoIt forums. Link to comment Share on other sites More sharing options...
sambalec Posted April 13, 2009 Author Share Posted April 13, 2009 Nice way ! And how to list on a Gui Window all lines ( in a select option for example ) and delete line from gui ? Link to comment Share on other sites More sharing options...
Cynagen Posted April 13, 2009 Share Posted April 13, 2009 Nice way ! And how to list on a Gui Window all lines ( in a select option for example ) and delete line from gui ?Can't help with that, I'm a console type guy, sorry. However there should be some GUI tutorials around here on the forums somewhere. Blah, blah, blah... lip service... lip service.Working on a number of projects right now, just waiting for my time to post them here on AutoIt forums. Link to comment Share on other sites More sharing options...
sambalec Posted April 13, 2009 Author Share Posted April 13, 2009 Ok thanks ! I try to ask somethink help on GUI Topic Link to comment Share on other sites More sharing options...
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