Jump to content

a function to find a line contains text of "blablabla"


Recommended Posts

maybe...

#include <file.au3>

$File_Name = "text.txt"
$Find = "my text to find"

Dim $aRecords
If Not _FileReadToArray($File_Name, $aRecords) Then
   MsgBox(4096,"Error", " Error reading log to Array     error:" & @error)
   Exit
EndIf
For $x = 1 to $aRecords[0]
    if StringInStr($aRecords[$x], $Find) Then Msgbox(0,'Record:' & $x, $aRecords[$x])
Next

8)

NEWHeader1.png

Link to comment
Share on other sites

Take a look at the File Manipulation functions in the helpfiles. Also, I'm sure a quick search on the forums could do you some good.

-CMR

i found only, FileReadLine function. which it's only to find a line according to a defined line number. what i want, is a function to search a string, and then returns the line number as a result.

EDIT: too late too :whistle:

Edited by soulhealer
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...