Hello everyone, here's how XLS turns JSON.
1, directly with the XLS tool can be transferred out of JSON (this is not introduced).
2, using the NODEJS program to perform the above JSON conversion operation, I use the Nodejs version is 4.2.2, the following paste all the code:
//File Upload//Gets the current time (month, day, minute, and seconds)functionGetnow () {varDate =NewDate (); varSeperator1 = ""; varSeperator2 = ""; varmonth = Date.getmonth () + 1; varStrdate =date.getdate (); if(Month >= 1 && month <= 9) {Month= "0" +month; } if(strdate >= 0 && strdate <= 9) {strdate= "0" +strdate; } varcurrentdate = date.getfullyear () + seperator1 + month + Seperator1 +strdate+ "" + date.gethours () + Seperator2 +date.getminutes ()+ Seperator2 + date.getseconds () +date.getmilliseconds (); returncurrentdate;}//Service StartvarExpress = require (' Express ');varApp =Express ();varFS = require ("FS");varHTTP = require (' http ');var$ = require ("jquery");varxlsx = require ("node-xlsx");//Use is JSONvarjson=NULL;varBodyparser = require (' Body-parser '));varMulter = require (' Multer ')); App.use (Express.static (' Public ') ); App.use (bodyparser.urlencoded ({extended:false}); App.use (Multer ({dest:'/tmp/'}). Array (' image ')); App.get ('/index.html ',function(req, res) {Res.sendfile (__dirname+ "/" + "index.html" );}); App.post ('/file_upload ',function(req, res) {varNamelast=getnow () + req.files[0].originalname; varDes_file = __dirname + "/files/" +Namelast; Fs.readfile (req.files[0].path,function(err, data) {//300M File Limit if(314572800<data.length) {response={code:15, msg:' File length is Max ', Data:"", Path:"", name:req.files[0].originalname}; Res.end (json.stringify (response)); } Else{ //Write FileFs.writefile (des_file, data,function(err) {if(Err) {Console.log (err); }Else{JSON=Xlsx.parse (Des_file); Response={code:0, msg:' File uploaded successfully ', Data:JSON.stringify (JSON), Path:namelast, Name:re q.files[0].originalname}; Fs.writefile ("Json.json", Json.stringify (JSON),function(err) {if(ERR)Throwerr; }); } res.end (Json.stringify (JSON)); }); } });}); varServer = App.listen (3000,function() {Console.log ("address:http://localhost:3000");});
Alternate address/demo:http://182.92.155.97:3000/index.html
How to use: Open the address, click the Upload Upload button to select the *.xls file upload, JSON data directly displayed on the page, of course, "Ctrl + a" all selected JSON:
END
Workaround for XLS direct to JSON