Jump to content

Recommended Posts

Posted

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

Posted

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.
Posted

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]

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
×
×
  • Create New...