You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mathias Rangel Wulff edited this page Nov 24, 2016
·
6 revisions
How to upload and parse CSV file from server and from desktop?
You can use [AlaSQL][1] library to load and parse CSV data from server or from desktop.
####From Server
You can and parse data with CSV() function:
alasql('SELECT * FROM CSV("mydata.csv",{headers:true})',[],function(data){// Use data});
####From Desktop
If you want to upload data from desktop you can use the following code:
<scriptsrc="alasql.min.js"></script><p>SelectCSVfiletoread:</p><inputid="readfile"type="file"onchange="loadFile(event)"/><script>functionloadFile(event){alasql('SELECT * FROM FILE(?,{headers:true})',[event],function(data){// Process data here});}</script>