My goal is to tread a text file with a list of numbers spearated by a newline/carriage return, and then get it into an array of the numbers.
I can read it using some sample code that uses readAsBinaryString is depreciated, so I’m trying to use the readAsArrayBuffer, which is the suggested replacement.
I’m reading the API docs, but can’t really make sense of it:
this documentation is also really slim:
I’m following some code examples but would also like to understand the docs which I am struggling with.
using an Array Buffer seems like a catch 22.
The array buffer requires a size specified before it is created, but I don’t know the size of the uploaded file until after it is read.
maybe I just need a readAsText method ?
Sample file I’m uploading is a text file that looks like this…only with 100,000 rows
54044 14108 79294 29649 25260 60660 2995 53777 49689 9083 16122 90436 4615 40660 25675 58943 92904 9900 95588