Mobile Safari does not have a File API , so I assume you are talking about reading from a web resource. You cannot do this. When you read a resource through ajax, the browser will first read it completely in memory, and then pass the entire string to your ajax callback as a string.
In your callback, you can take a line and break it into lines and wrap it in an object that has an API that your code needs, but you will still have the line in memory right away ..
source share