JS

JAVASCRIPT READ CSV FILE INTO ARRAY

JUST A SINGLE FILE INPUT FIELD <input type="file" accept=".csv" id="demo"/>

THE HTML

01

FILE PICKER let picker = document.getElementById("demo");    picker.onchange = () => {   GET SELECTED FILE   let selected = picker.files[0];

THE JAVASCRIPT

02

  READ CSV FILE INTO ARRAY   let reader = new FileReader();   reader.addEventListener("loadend", () => {     let data = reader.result.split("\r\n");     for (let i in data)     { data[i] = data[i].split(","); }   });    reader.readAsText(selected);  };