TSV with empty first cell recognized wrong #1421

Closed
opened 2019-01-30 11:27:00 +00:00 by bendlas · 4 comments
bendlas commented 2019-01-30 11:27:00 +00:00 (Migrated from github.com)

When trying to parse a tab-separated-value sheet, where the first cell is empty - that means that the first byte is a '\t' character - the parser jumps into the wrong file format here 1eb1ec985a/xlsx.js (L20310)

When trying to parse a tab-separated-value sheet, where the first cell is empty - that means that the first byte is a '\t' character - the parser jumps into the wrong file format here https://github.com/SheetJS/js-xlsx/blob/1eb1ec985a640b71c5b5bbe006e240f45cf239ab/xlsx.js#L20310
OrangeOlko commented 2019-05-16 20:48:28 +00:00 (Migrated from github.com)

Hello,

got the same issue.
Is there any workaround?

Hello, got the same issue. Is there any workaround?
SheetJSDev commented 2019-05-16 22:19:46 +00:00 (Migrated from github.com)

Thanks for reporting!

This particular decision is based on older file formats. "BIFF2" / "BIFF3" / "BIFF4" (the "XLS" formats used in Excel prior to Excel '95) actually start with a tab character 0x09. The next character for the BIFF formats is 0x04 (corresponding to the BOF record).

Would it suffice to use plaintext parsing if the next character is not 0x04?

Thanks for reporting! This particular decision is based on older file formats. "BIFF2" / "BIFF3" / "BIFF4" (the "XLS" formats used in Excel prior to Excel '95) actually start with a tab character `0x09`. The next character for the BIFF formats is `0x04` (corresponding to the BOF record). Would it suffice to use plaintext parsing if the next character is not `0x04`?
Ramzec commented 2019-10-02 23:20:26 +00:00 (Migrated from github.com)

any update?

any update?
SheetJSDev commented 2019-10-03 06:37:28 +00:00 (Migrated from github.com)

This is an easy PR:

https://github.com/SheetJS/js-xlsx/blob/master/bits/87_read.js#L85

-		case 0x09: return parse_xlscfb(d, o);
+		case 0x09: if(n[1] <= 0x04) return parse_xlscfb(d, o); break;
This is an easy PR: https://github.com/SheetJS/js-xlsx/blob/master/bits/87_read.js#L85 ```diff - case 0x09: return parse_xlscfb(d, o); + case 0x09: if(n[1] <= 0x04) return parse_xlscfb(d, o); break; ```
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#1421
No description provided.