Jump to content
Sign in to follow this  

Idea for a new String-UDF

Recommended Posts


Hi guys,

i've got a little problem and i think an UDF would be a good idea to solve it :dance: 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'.


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!


An 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 :whistle:

Edited by Baku

Share this post

Link to post
Share on other sites

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)
Edited by this-is-me

Who else would I be?

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.