Baku Posted August 2, 2005 Share Posted August 2, 2005 (edited) Hi guys,i've got a little problem and i think an UDF would be a good idea to solve it But, coz of my poor au3skills I cant create one. But maybe someones else can try it, thanks in advance for everyone who's tryin'.Problem:I've got a very Huge File which I open with FileOpen(). It has got like 803 lines. It's a HTML-File. There are some important lines which i wanna use with FileReadLine(). The problem is, i dunno in what line it is. But i know whats written in these lines!SolutionAn UDF which can find a String in a FileOpen-String and return the line. If someone has a better idea, please tell me how u would solve this problem.Thx in advance, greetings Edited August 2, 2005 by Baku Link to comment Share on other sites More sharing options...
this-is-me Posted August 2, 2005 Share Posted August 2, 2005 (edited) It's pretty easy. $filename = "C:\boot.ini" $searchfor = "windows" $file = FileRead($filename, FileGetSize($filename)) $lines = StringSplit($file, @CRLF, 1) For $i = 1 to $lines[0] If StringInStr($lines[$i], $searchfor) Then MsgBox(0,"","Line number: " & $i) EndIf Next Edited August 2, 2005 by this-is-me Who else would I be? Link to comment Share on other sites More sharing options...
Baku Posted August 2, 2005 Author Share Posted August 2, 2005 hell, you're awesome Thank you very much! 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