I am looking to utilize AngularJS to read and store the data from a CSV file that is uploaded using an input type file.
My approach involves leveraging AngularJS with an input type file to handle CSV, xls, or xlsx files in the following manner:
HTML:
<input class="btn btn-default col-xs-6" type="file" accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" onchange="angular.element(this).scope().checkFormat(this.files)">
JavaScript/AngularJS:
$scope.checkFormat = function(files) {
var fd = new FormData();
//Take the first selected file
fd.append("file", files[0]);
}
What is the best way for me to iterate through this CSV file row by row and add each row into an array?