I'm having problems using split to try and parse a text file. the text file is as shows:
123.0 321.02
342.1 234.03
425.3 326.33
etc. etc.
When I read using a FileReader() and doing a readAsText call on the file, the file appears in a string as such:
"123.0 321.02\r\n342.1 234.03\r\n ..." (How it appears in Firebug)
Currently I'm trying to split it like this:
var reader = FileReader();
reader.readAsText(f);
alert(reader.result);
var readInStrings = reader.result.split(/|\s|\n|\r|/);
but when I do this, the resulting array has values as shown:
["123.0", "321.02", "", "342.1", "234.03", "" etc....]
Can anyone explain to me where the values of {""} in the array are coming from and how to correctly split such a file as to only get the number strings as the values?
Any help would be greatly appreciated, thanks!
Note*: Currently doing this in javascript