cyph / cordova-plugin-chooser

Cordova file chooser plugin.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to convert CSV file to JSON after get file from chooser plugin

wasinr opened this issue · comments

Hi!

Anyone know How to convert CSV file to JSON after get file from chooser plugin. Now I got data response back from Chooser plugin but I dont know how to convert it to JSON

my code is

async chooseFile(type) {
    this.chooser
      .getFile()
      .then((file: any) => {
        // let filename = file ? file.name : "canceled";
        alert(file.data);
        alert(JSON.stringify(file.data));
});
}