Data Scrambled #2906

Closed
opened 2023-03-27 23:03:42 +00:00 by ycrz · 5 comments

Please kindly check the output (the image) after importing the excel. Thank you!

Please kindly check the output (the image) after importing the excel. Thank you!
78 KiB
15 KiB
Author

notes: i use version:"1.15.0"

*notes:* i use version:"1.15.0"
Owner

The latest version is 0.19.2, so you may be using a different library.

But as for the question, the order should be correct. To verify, go to https://oss.sheetjs.com/ and drop your test file. That library reads the file with XLSX.read and extracts the data using XLSX.utils.sheet_to_json(worksheet, { header: 1 })

If you can share a code snippet, we can try to reproduce and reopen the issue.

The latest version is 0.19.2, so you may be using a different library. But as for the question, the order should be correct. To verify, go to https://oss.sheetjs.com/ and drop your test file. That library reads the file with `XLSX.read` and extracts the data using `XLSX.utils.sheet_to_json(worksheet, { header: 1 })` If you can share a code snippet, we can try to reproduce and reopen the issue.
Author

how about this var cptable={version:"1.15.0"}

how about this var cptable={version:"1.15.0"}
Author

This is the script

<script src="xlsx.full.min.js"></script>

var url = 'filedir.xlsx';

/* set up async GET request */
var req = new XMLHttpRequest();
req.open("GET", url, true);
req.responseType = "arraybuffer";

req.onload = function(e) {
    var data = new Uint8Array(req.response);
    var workbook = XLSX.read(data, {type:"array"});

    dataProcess(workbook.Strings);
}
req.send();

function dataProcess(workbook){
    console.log(workbook);
}
This is the script ``` <script src="xlsx.full.min.js"></script> var url = 'filedir.xlsx'; /* set up async GET request */ var req = new XMLHttpRequest(); req.open("GET", url, true); req.responseType = "arraybuffer"; req.onload = function(e) { var data = new Uint8Array(req.response); var workbook = XLSX.read(data, {type:"array"}); dataProcess(workbook.Strings); } req.send(); function dataProcess(workbook){ console.log(workbook); } ```
ycrz reopened this issue 2023-03-29 09:26:49 +00:00
Author

woah...

it should be like this

<script src="xlsx.full.min.js"></script>

<script type="text/javascript">
    var url = 'c.xlsx';

    /* set up async GET request */
    var req = new XMLHttpRequest();
    req.open("GET", url, true);
    req.responseType = "arraybuffer";

    req.onload = function(e) {
        // var data = new Uint8Array(req.response);
        const bookData = XLSX.readFile(req.response);
        const sheetRaw = bookData.Sheets[bookData.SheetNames[0]]
        workbook = XLSX.utils.sheet_to_json(sheetRaw,{ header: 1 })

        dataProcess(workbook);
    }
    req.send();

    function dataProcess(workbook){
        console.log(workbook);
    }
</script>

thanks!

woah... it should be like this ``` <script src="xlsx.full.min.js"></script> <script type="text/javascript"> var url = 'c.xlsx'; /* set up async GET request */ var req = new XMLHttpRequest(); req.open("GET", url, true); req.responseType = "arraybuffer"; req.onload = function(e) { // var data = new Uint8Array(req.response); const bookData = XLSX.readFile(req.response); const sheetRaw = bookData.Sheets[bookData.SheetNames[0]] workbook = XLSX.utils.sheet_to_json(sheetRaw,{ header: 1 }) dataProcess(workbook); } req.send(); function dataProcess(workbook){ console.log(workbook); } </script> ``` thanks!
ycrz closed this issue 2023-03-29 09:33:57 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sheetjs/sheetjs#2906
No description provided.