Jump to content
Sign in to follow this  
DjDeep00

Limit for _FilereadtoArray

Recommended Posts

DjDeep00

I am trying to read a huge file that is 333 MB (341,937 KB) into an array. Not sure exactly what element it craps out at but I get the generic windows error message "Autoitv3.exe has encountered a problem". Please advise.

Thanks.

Share this post


Link to post
Share on other sites
MadBoy

I am trying to read a huge file that is 333 MB (341,937 KB) into an array. Not sure exactly what element it craps out at but I get the generic windows error message "Autoitv3.exe has encountered a problem". Please advise.

Thanks.

_FileReadToArray is mostly to be used for text files or other readable information files. Doubtfull that you have 333mb file with text in it ;P

For use on binary files use FileOpen in Binary mode (check newest helpfile for stable beta) and do things there with it.


My little company: Evotec (PL version: Evotec)

Share this post


Link to post
Share on other sites
DjDeep00

_FileReadToArray is mostly to be used for text files or other readable information files. Doubtfull that you have 333mb file with text in it ;P

For use on binary files use FileOpen in Binary mode (check newest helpfile for stable beta) and do things there with it.

MadBoy,

The file that I am trying to read into an array is a HTML file which is all text in one huge table format (no pics or anything else). The HTML file was created by SQLPlus by using the "markup html on" and then spooling it to a file.

Share this post


Link to post
Share on other sites
MadBoy

MadBoy,

The file that I am trying to read into an array is a HTML file which is all text in one huge table format (no pics or anything else). The HTML file was created by SQLPlus by using the "markup html on" and then spooling it to a file.

That's one large file!!! Maybe try this and see if it helps.

#include <array.au3>

Global $file_array[1]
$file = FileOpen("c:\test.txt", 0)

; Check if file opened for reading OK
If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf

; Read in lines of text until the EOF is reached
While 1
    $line = FileReadLine($file)
    If @error = -1 Then
        $file_array[0] = Ubound($file_array)-1
        ExitLoop
    EndIf
    _ArrayAdd($file_array, $line)
Wend

FileClose($file)

_ArrayDisplay($file_array)

My little company: Evotec (PL version: Evotec)

Share this post


Link to post
Share on other sites
SmOke_N

Hard to imagine this ... but are you sure you haven't reached your string or array limit?

Edit:

I should add I can't remember what the actual string limit is, something like 2 billion chars or something... and thinking about it... that would be the equivelent of like 1 to 2 gigs depending on the format.... sounds kind of unlikely that being the issue.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
PsaltyDS

Hard to imagine this ... but are you sure you haven't reached your string or array limit?

Edit:

I should add I can't remember what the actual string limit is, something like 2 billion chars or something... and thinking about it... that would be the equivelent of like 1 to 2 gigs depending on the format.... sounds kind of unlikely that being the issue.

More likely the AutoIt array limit of 16M elements (24 bit number). The help file for Arrays doesn't say it, but under Dim\Global\Local:

When creating arrays you are limited to up to 64 dimensions and/or a total of 16 million elements.

What ever you were going to iterate through that array with you could just as easily iterate with FileReadLine() from the file itself without hitting that limit.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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  

×