Giter Site home page Giter Site logo

how to read excel in browser? about excelize-wasm HOT 3 OPEN

xuri avatar xuri commented on May 22, 2024
how to read excel in browser?

from excelize-wasm.

Comments (3)

CapitanHeMo avatar CapitanHeMo commented on May 22, 2024

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.

from excelize-wasm.

jamninetyfive avatar jamninetyfive commented on May 22, 2024

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

from excelize-wasm.

jamninetyfive avatar jamninetyfive commented on May 22, 2024

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.

from excelize-wasm.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.