hello everyone I want to get the data line by line I have done it successfully now I want line by line plus word by word so I used this code
var openFile = function(event) {
var input = event.target;
var reader = new FileReader();
reader.onload = function(){
var text = reader.result;
var node = document.getElementById('output');
node.innerText = text;
var lines = this.result.split('\n');
for(var line = 0; line < lines.length; line++){
console.log(lines[line].split(" "));
}
};
reader.readAsText(input.files[0]);
};
the result is shocking in the console I am getting \r with the string