I am working on a project where I want to read content from a file and want to get useful information from its data and display it to user, for example suppose I have a text file (.txt) in which there are 10 lines like "sham went to school", "Rohan bought a new pen" etc. I know this is a silly example but just want to deliver the basic idea. I want to read this content in Ionic and want to show it to user in a beautiful and elegant way after some sort of manipulation. I am using cordova file chooser plugin, now want to read file content as I mentioned above. Any help will be appreciated, Thanks in advance :)
I have tried http get function to read a file but don't know how to use it with choosen file. I made below function and now I have no idea how to pass that file as argument to this function
public readFile(file) {
this.http.get(file).pipe(map(res => res.text()))
.subscribe(data => {
this.requests = data.split('\n');
this.testtext = this.requests[20];
});