Comments (8)
Does it work with the browser demo http://oss.sheetjs.com/js-xls/ ?
If not, does it work with the command line tool? To get that, install node then npm install -g xlsjs
and run xls2csv
.
If it doesn't work in either place, can you send me the actual file?
from sheetjs.
Actually there is nothing with reading excel.The problem is the code block inside xls.js below break down another js functionality.For example my left menu doesn't work.
Code:
Array.prototype.readUInt8 = function(idx) { return this[idx]; };
Array.prototype.readUInt16LE = function(idx) { return this[idx+1](1<<8)+this[idx]; };
Array.prototype.readInt16LE = function(idx) { var u = this.readUInt16LE(idx); if(!(u & 0x8000)) return u; return (0xffff - u + 1) * -1; };
Array.prototype.readUInt32LE = function(idx) { return this[idx+3](1<<24)+this[idx+2](1<<16)+this[idx+1](1<<8)+this[idx]; };
Array.prototype.readInt32LE = function(idx) { var u = this.readUInt32LE(idx); if(!(u & 0x80000000)) return u; return (0xffffffff - u + 1) * -1; };
Array.prototype.readDoubleLE = function(idx) { return readIEEE754(this, idx||0);};
from sheetjs.
@cemiley the only prototype method involving split is the reverse function:
String.prototype.reverse=function(){return this.split("").reverse().join("");};
I will remove that from the prototype soon. In the interim, can you check if your code also adds a reverse prototype method to String?
from sheetjs.
@Niggler there is no reverse prototype method in my code
from sheetjs.
@cemiley are you possibly doing a for..in loop on an array? The prototype methods would show up there. For example:
> Array.prototype.readUInt8 = function(idx) { return this[idx]; };
[Function]
> for(y in [5,6,7]) console.log(y)
0
1
2
readUInt8
The correct way to do this loop is to put a guard:
> var x = [5,6,7]; for(y in x) if(x.hasOwnProperty(y)) console.log(y)
0
1
2
from sheetjs.
when i run in console for(y in [5,6,7]) console.log(y) the output is:
for(y in [5,6,7]) console.log(y)
0 VM460:2
1 VM460:2
2 VM460:2
readUInt8 VM460:2
readUInt16LE VM460:2
readInt16LE VM460:2
readUInt32LE VM460:2
readInt32LE VM460:2
readDoubleLE VM460:2
hexlify VM460:2
utf16le VM460:2
utf8 VM460:2
lpstr VM460:2
lpwstr VM460:2
toBuffer VM460:2
undefined
when i run var x = [5,6,7]; for(y in x) if(x.hasOwnProperty(y)) console.log(y)
the output is:
0 VM464:2
1 VM464:2
2 VM464:2
undefined
actually i couldn't understand what should i do ?
from sheetjs.
@cemiley you shouldn't be iterating over an array using for .. in
syntax. Either use an iterative loop:
for(var i = 0; i != array.length; ++i) { /* use array[i] to access the object */ }
or use the functional forEach loop:
array.forEach(function(y) { /* y is the object here */ })
If you want a longer explanation, this answer on SO may be a good starting point
from sheetjs.
Related: #28
Issue has been resolved by removing all prototype methods.
from sheetjs.
Related Issues (20)
- Gettting an Array, but of scrambled data 😰 HOT 2
- sheet_to_json from remote file not working HOT 2
- Unable to set name for worksheet separately from workbook HOT 3
- xlsx CP932 Incorrect output HOT 3
- Error appears in bower js-xlsx#~0.11.5 HOT 4
- sheet_to_json: inconsistent blank cell parsing HOT 2
- format entire column HOT 2
- reading text in shapes HOT 1
- Rearranging the XLSX.write order HOT 1
- Add VBA script to file I am creating from scratch HOT 2
- Wrong filename when download file HOT 1
- How to Define name for a range ? HOT 1
- Need to Prevent formatting of dates while reading a csv
- No option to change delimiter when writing CSV HOT 1
- Export to excel- Hyperlink doesn't work on documentation page HOT 1
- reading and writing the excel with Symbols,photos, in different tabs.
- QUOTE not defined HOT 9
- [Security] Prototype Pollution in sheetJS HOT 27
- Archive this GitHub Project HOT 3
- Thanks!
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sheetjs.