Sign in to follow this  
Followers 0
tarre

filereadline from the end to the start

5 posts in this topic

heya. im searching for an function that reads my file from the end to the start. ive searched \ googled but didnt get anything :)

this would be very useful. thx

Share this post


Link to post
Share on other sites



Perhaps have a look at the nice function called:

FileReadLine();

:)

Neo

but that reads from the top to the bottom. i want to read from the bottom to the top :/. i dont have any ideas how to acomplish that.

Share this post


Link to post
Share on other sites

Here a little example which reads from the bottom till the top:

#include <file.au3>
$CountLines = _FileCountLines("test.txt")
$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 lines of text until the top of the file is reached
For $i=$Countlines to 1 Step -1
    $line = FileReadLine($file,$i)
    MsgBox(0, "Line read:", $line)
Next

FileClose($file)

Greetz,

Neo


[center][font="Arial"]--- The Neo and Only --- [/font][font="Arial"]--Projects---[/font]Image to Text converterText to ASCII converter[/center]

Share this post


Link to post
Share on other sites

thanks alot.

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  
Followers 0