title: js-xlsx: How to delete row with merged cells?
body: <p>I'm trying to get json data out of xlsx file but stumbled upon weird 'js-xlsx' behaviour. If I have a table with merged cells in the heading then I get only first row of data in output from the table. If i delete this row manually (in EXCEL) - then I get all data as it should be. If I unmerge this cell manually - once again: all data in json. </p>
  
  <p>So the problem is with the merged cells and the task is to skip it\avoid it in export\delete it\do smth whatever else...</p>
  
  <p>I tried to delete this row via 'js-xlsx', got some code from SO accepted answer but it's not helping and seems a bit odd dealing with merged cells:</p>
  
  <pre><code>    const XLSX = require('xlsx');
      let workbook = XLSX.readFile('./downloads/wb_sales.xlsx');
      var worksheet = workbook.Sheets[workbook.SheetNames[0]];
  
      function ec(r, c){
          return XLSX.utils.encode_cell({r:r,c:c});
      }
      function delete_row(ws, row_index){
          var variable = XLSX.utils.decode_range(ws["!ref"])
          for(var R = row_index; R &lt; variable.e.r; ++R){
              for(var C = variable.s.c; C &lt;= variable.e.c; ++C){
                  ws[ec(R,C)] = ws[ec(R+1,C)];
              }
          }
          variable.e.r--
          ws['!ref'] = XLSX.utils.encode_range(variable.s, variable.e);
      }
      // trying to delete first row
      delete_row(worksheet,0)
  
      // here I get just the first row of data
      console.log(XLSX.utils.sheet_to_json(worksheet));
  </code></pre>
  
  <p>Tried <code>worksheet[!'merged']=''</code> - it clears the cell, but merged status stays.</p>
  
  <p>Tried </p>
  
  <pre><code>var range = XLSX.utils.decode_range(worksheet['!ref']);
          range.s.r = 1; // &lt;-- skipping first row with merged cell, but not working either.
          worksheet['!ref'] = XLSX.utils.encode_range(range);
  </code></pre>
  
  <p>No good. Same output.</p>
  
  <p>Tried <code>worksheet['A1']=worksheet['A2']</code> it copies content but merging stays.</p>
  
  <p>Regarding above said:</p>
  
  <ol>
  <li>How to delete first row in this task (not clearing cells content but deleting)? </li>
  <li>How do I unmerge merged cells?</li>
  <li>How do I delete merged cells (not clearing the cell, but deleting it).</li>
  </ol>
  
  <p>Rays of gratefulness to all :)</p>