I have a large text file to be opened (eg- 5GB size). But with a limited RAM (take 1 GB), How can I open and read the file with out any memory error? I am running on a linux terminal with with the basic packages installed.
This was an interview question, hence please do not look into the practicality.
I do not know whether to look at it in System level or programmatic level… It would be great if someone can throw some light into this issue.
Thanks.
Read it character by character… or X bytes by X bytes… it really depends what you want to do with it… As long as you don’t need the whole file at once, that works.
(Ellipses are awesome)