I have an angular2 component that let user upload a file. This is how i read files when uploaded: template:
<div>
Select file:
<input type="file" (change)="changeListener($event)" >
</div>
And changeListener code portion for read file:
var reader:FileReader = new FileReader();
reader.onloadend = function(e){
console.log(reader.result);
}
reader.readAsText(event.target.files[0], 'ISO-8859-1');
In this way i'm able to read entire file, but i need to read line by line. How can i do ?