-
Notifications
You must be signed in to change notification settings - Fork 659
How to import and export Excel files to javascript array
Mathias Rangel Wulff edited this page Mar 14, 2017
·
4 revisions
Source: StackOverflow.com
I'm currently looking for a fast and efficient way to import an Excel file into a javascript array, and export it also. I also need a way to do the same thing, but the opposite way.
For import:
alasql('SELECT * FROM XLSX("srcfileName")'].then(function(data){
console.log(data);
});
For export:
var data = [{a:!,b:10},{a:2,b:20}];
alasql('SELECT * INTO XLSX("myfileName") FROM ?',[data]);
Import and export with interim data processing:
alasql('SELECT * \
INTO XLSX("myfile.xlsx",{headers:true}) \
FROM XLSX("srcfile.xlsx",{headers:true}) \
WHERE Age > 20 \
GROUP BY LastName \
HAVING COUNT(*) > 2 \
ORDER BY LastName, FirstName');
© 2014-2024, Andrey Gershun & Mathias Rangel Wulff
Please help improve the documentation by opening a PR on the wiki repo