Unfortunately, for loops build a list out of their contents, which means that the code above will read the entire file into memory. while is the right way to process a line at a time.
In reply to Re^2: Out of memory problem when copying contents of file into array
by chromatic
in thread Out of memory problem when copying contents of file into array
by junky123
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |