title: getting the excel sheet data in json format with in react js (i tried split() and includes() function )
body: <pre><code>[input][1]
        [1]: https://i.stack.imgur.com/cHdgt.png
      output:
      const data = {
  
  [
  
      "device key":"key1",
  
      "brandname":"brandname1",
  
       "version"20,
  
       contact:[
  
          {phone:763736762,email:abc@gmaill.com},
  
          {phone:4536726633,email:def@gmail.com}
  
       ]
     ],
  
    [
     "device key":"key2".
  
     "brandname":"brandname 2",
  
     "version"90,
  
       contact:[
         {phone:456445566,email:xyz@gmail.com},
  
         {phone:456445566,email:xyz@gmail.com},
  
       ]
  
     ]
  
  }
  
  code:
  
    handleFile(file) {
      let json_object ='';
      const reader = new FileReader();
      const fileName = file.name;   
  
      const rABS = !!reader.readAsBinaryString;
      reader.onload = ({ target: { result } }) =&gt; {
        const wb = XLSX.read(result, { type: rABS ? "binary" : "array" });
  
  
        const wsname = wb.SheetNames[0];
        const ws = wb.Sheets[wsname];
        const data = XLSX.utils.sheet_to_json(ws, { header: 1 });
  
  
        wb.SheetNames.forEach(function(sheetName) {
  
          var XL_row_object = XLSX.utils.sheet_to_row_object_array(wb.Sheets[sheetName]);
  
           console.log("length od arr",XL_row_object["length"])
          const jsondata = {
            "list":XL_row_object,
            "filename":fileName,
            "length":XL_row_object["length"]
          }
  
           json_object = JSON.stringify(jsondata);
  
  
        })
  
  
  
            this.props.setTable(data,json_object,);
      };
  </code></pre>
  
  <p>I have excel data like shown in the image. I have to add that data into a 
  json format as described  in output.</p>
  
  <p>have to display that information into a table .
  (Headers are dynamic)
  and have to post the data into backend api call to db.
  tried multiple ways
  alreday used slice and include functions.</p>
  
  <p>any response is appriciated.</p>