HTML support #419

Closed
opened 2016-05-26 14:19:09 +00:00 by vineetl · 5 comments
vineetl commented 2016-05-26 14:19:09 +00:00 (Migrated from github.com)

While doing a readFile for .xls file following error occurs.

switch(state[state.length-1][0]) {
^

TypeError: Cannot read property '0' of undefined
at parse_xlml_xml (/home/abc/node_modules/xlsx/xlsx.js:8815:32)
at parse_xlml (/home/abc/node_modules/xlsx/xlsx.js:9171:53)
at readSync (/home/abc/node_modules/xlsx/xlsx.js:11393:21)
at Object.readFileSync (/home/abc/node_modules/xlsx/xlsx.js:11403:9)
at Object. (/home/abc/readXL.js:2:20)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)

please help me out

While doing a readFile for .xls file following error occurs. switch(state[state.length-1][0]) { ^ TypeError: Cannot read property '0' of undefined at parse_xlml_xml (/home/abc/node_modules/xlsx/xlsx.js:8815:32) at parse_xlml (/home/abc/node_modules/xlsx/xlsx.js:9171:53) at readSync (/home/abc/node_modules/xlsx/xlsx.js:11393:21) at Object.readFileSync (/home/abc/node_modules/xlsx/xlsx.js:11403:9) at Object.<anonymous> (/home/abc/readXL.js:2:20) at Module._compile (module.js:541:32) at Object.Module._extensions..js (module.js:550:10) at Module.load (module.js:458:32) at tryModuleLoad (module.js:417:12) at Function.Module._load (module.js:409:3) please help me out
chenvan commented 2016-11-24 04:35:32 +00:00 (Migrated from github.com)

I meet the same problem. I solve it by save the document again.

I meet the same problem. I solve it by save the document again.
SheetJSDev commented 2017-02-23 06:20:34 +00:00 (Migrated from github.com)

@vineetl @chenvan can you share a file that shows this problem? I suspect those are really HTML files that happen to have the XLS extension, since that particular error and codepath mean the file started with a < (which the library guesses is a SpreadsheetML file)

@vineetl @chenvan can you share a file that shows this problem? I suspect those are really HTML files that happen to have the XLS extension, since that particular error and codepath mean the file started with a `<` (which the library guesses is a SpreadsheetML file)
chenvan commented 2017-02-26 03:26:53 +00:00 (Migrated from github.com)

@SheetJSDev your guess is maybe right. My document is exported from a website which is about chinese stock markets. Do you still want me to send you a copy? I don't know how to send to you? An email?

@SheetJSDev your guess is maybe right. My document is exported from a website which is about chinese stock markets. Do you still want me to send you a copy? I don't know how to send to you? An email?
SheetJSDev commented 2017-02-26 03:30:50 +00:00 (Migrated from github.com)

@chenvan You can send an email to com sheetjs dev

@chenvan You can send an email to com sheetjs dev
SheetJSDev commented 2017-02-26 03:53:58 +00:00 (Migrated from github.com)

@chenvan received the file. As I guessed, it was an HTML file. This export is particularly interesting because of the number format hints in the style:

<td style="text-align:right;mso-number-format:0.00;">

We'll keep this issue open until we decide how to handle HTML files.

@chenvan received the file. As I guessed, it was an HTML file. This export is particularly interesting because of the number format hints in the style: ```html <td style="text-align:right;mso-number-format:0.00;"> ``` We'll keep this issue open until we decide how to handle HTML files.
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sheetjs/sheetjs#419
No description provided.