In HTML5, it's easy to slice a (huge) file if I know start byte and end byte:
var reader = new FileReader();
var blob = file.slice(start, end);
reader.readAsBinaryString(blob);
But what if I want to slice a huge text file from String A to String B? I don't know where those start/end bytes will be! If I try to place content of the whole file in a single string and extract content using event.target.result.slice(event.target.result.indexOf("stringA"), event.target.result.indexOf("stringB"))
, oh, no... it doesn't look good...
So, is it possible to write a function which will return value indicating an "offset" (byte) of a selected string in a file? (This function must return array consisting of multiple values if a string is not unique in a file).