sheetjs icon indicating copy to clipboard operation
sheetjs copied to clipboard

How change selection of columns of sheets?

Open jcsena opened this issue 11 years ago • 1 comments

how change selection of columns of sheets?

i have the next sheet

image

xlsx.utils.sheet_to_row_object_array(workbook.Sheets['sheet1']);

and the result is

[
  {"undefined":"LastName","January":"Time"},
  {"undefined":"date2","January":"12:05"},
  {"undefined":"date3","January":"12:03"}, 
  {"undefined":"date4","January":"1:03"}
]

I would get this

[
  {"Name":"date1","LastName":"date2","Time":"12:05"},   
  {"Name":"date2","LastName":"date3","Time":"12:03"},
  {"Name":"date3","LastName":"date4","Time":"1:03"}
]

How I can get this with the format sheet?

jcsena avatar Sep 07 '15 15:09 jcsena

XLSX.utils.sheet_to_row_object_array(workbook.Sheets['sheet1'], {range:1});

We added this to the docs: https://github.com/sheetjs/js-xlsx#json

SheetJSDev avatar Mar 19 '17 07:03 SheetJSDev