ParoXsitiC Posted August 30, 2010 Posted August 30, 2010 (edited) The only thing I have seen was everyone recommending Randallc's TailRW.However, his examples seem confusing and they cause AutoIT.exe to crash. I am not sure if I am doing something wrong or it's not made for Windows 7.Either way, I am looking for something super simple, like this:_FileReadLine($iLine)Where if $iLine is negative, it takes the end lines. Thus: _FileReadLine(-100) retrieves the last 100 lines of a file.If its not possible to read lines, then I would be OK with reading a number of [b/b]ytes. I am also interested in reading in the first 100 lines without loading all of them.Please don't recommend using FileReadToArray and processing it that way. I am looking for something that can do a 5-10GB file in under 1/2 second. Edited August 30, 2010 by ParoXsitiC
AdmiralAlkex Posted August 30, 2010 Posted August 30, 2010 Open the file in binary mode with FileOpen() and use FileRead() to read? You can use FileSetPos() to move around in the file. Sounds right in my head You need an example? .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
ParoXsitiC Posted August 30, 2010 Author Posted August 30, 2010 Open the file in binary mode with FileOpen() and use FileRead() to read? You can use FileSetPos() to move around in the file. Sounds right in my head You need an example?I knew of FileOpen and FileRead, but not FileSetPos. However, this works good for bytes, but it would be preferable if I could indicate how many lines.
MilesAhead Posted August 31, 2010 Posted August 31, 2010 How big are the files you anticipate handling? If not that large _FileReadToArray() reads the file into an array. $array[0] has the count of lines. It may not be the fastest way to do it. But if you screen out super huge files it may be simplest and therefore not bug prone. My Freeware Page
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