Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

xlsx js

<script src="https://unpkg.com/xlsx/dist/xlsx.full.min.js"></script>
// Read XLSX file
$(function () {
  $('#file').on('change', function (e) {
    const file = e.target.files[0];
    const reader = new FileReader();

    reader.onload = function (e) {
      var data = e.target.result;
      var workbook = XLSX.read(data, {
        type: 'binary'
      });
      var first_sheet_name = workbook.SheetNames[0];
      var worksheet = workbook.Sheets[first_sheet_name];
      var result = XLSX.utils.sheet_to_json(worksheet);
      console.log(result);
    };

    reader.readAsBinaryString(file);
  });
})
 
PREVIOUS NEXT
Tagged: #xlsx #js
ADD COMMENT
Topic
Name
2+9 =