-
-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to read excel in browser? #17
Comments
Good afternoon @jamninetyfive . Today I encountered the same problem as you. Here is an example code for reading Excel file data from the browser, unfortunately the performance is low. It takes 40 seconds to read a file weighing approximately 8 megabytes (190,000 lines * 6 columns). Example code: <html lang="en">
<head>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/index.min.js"></script>
</head>
<body>
<input type="file" id="convert-button" multiple />
<script type="module" lang="js">
document
.getElementById("convert-button")
.addEventListener("change", async function (e) {
var excelize = await excelizeWASM.init(
"https://cdn.jsdelivr.net/npm/[email protected]/excelize.wasm.gz"
);
let reader = new FileReader();
reader.onload = function () {
let byteArray = new Uint8Array(reader.result);
let f = excelize.OpenReader(byteArray);
let rows = f.GetRows("<Sheet name>");
console.log(rows);
};
reader.readAsArrayBuffer(this.files[0]);
});
</script>
</body>
</html> This may not be the best use of the library, but I hope it helps you. I would be glad for any corrections, good luck. |
Thank you for your try and reply. I have gained something. I think the time-consuming part may be in buffer conversion, but thank you for trying. Can it read images? @CapitanHeMo |
I've tried this, tried reading 4000 images, it took 4 hours, my chrome crashed, and I can't stop it, there doesn't seem to be a solution. |
Description
Steps to reproduce the issue:
how to read excel in browser?
Describe the results you received:
Describe the results you expected:
Output of
node -v
:Output of
npm -v
:Output of
go version
:Excelize version or commit ID:
Environment details (OS, Microsoft Excel™ version, Browser version, physical, etc.):
The text was updated successfully, but these errors were encountered: