Read internal excel file using React

Viewed 291

I have an excel file stored in src folder. I want to use react to read the excel file directly instead of uploading a file using input field and show the object array to the console, does anyone know how to do it? Any reference link about that? I saw a lot about uploading an excel file and output the data, but I don't want to upload the file. I want to import the file directly or fetch data from the file. Let me know if you know how to do in react. Thanks.

1 Answers

You could use FileReader API. Here's a link to similar question. You could parse/read the excel file using this package.

A little suggestion, would be to use .csv or .json files instead of .xlsx files, if you are only dealing in data.

Related