Not parsing line delimiter correctly in CSV #648

Closed
opened 2017-05-06 21:33:34 +00:00 by charlesread · 1 comment
charlesread commented 2017-05-06 21:33:34 +00:00 (Migrated from github.com)

I have a very simple CSV file (two columns, first is a number, second is a string) that I am trying to parse, when XLSX parses it I get the output below. I don't see any options for specifying the line delimiter and I am not entirely sure what's going on, how can I fix this?

1,charles
2,cricket
3,ladybug
4,sara

==>

{ A1: { t: 'n', w: '1', v: 1 },
  B1: { t: 's', v: 'charles\r2' },
  C1: { t: 's', v: 'cricket\r3' },
  D1: { t: 's', v: 'ladybug\r4' },
  '!ref': 'A1:D1' }
I have a very simple CSV file (two columns, first is a number, second is a string) that I am trying to parse, when XLSX parses it I get the output below. I don't see any options for specifying the line delimiter and I am not entirely sure what's going on, how can I fix this? ```csv 1,charles 2,cricket 3,ladybug 4,sara ``` ==> ```js { A1: { t: 'n', w: '1', v: 1 }, B1: { t: 's', v: 'charles\r2' }, C1: { t: 's', v: 'cricket\r3' }, D1: { t: 's', v: 'ladybug\r4' }, '!ref': 'A1:D1' } ```
charlesread commented 2017-05-09 19:06:40 +00:00 (Migrated from github.com)

I greatly appreciate the effort! But now the XLSX.readFile() returned object is just

{ Sheets: {},
  SheetNames: [],
  Workbook: { Sheets: [] },
  SSF: 
   { '0': 'General',
     '1': '0',
     '2': '0.00',
     '3': '#,##0',
     '4': '#,##0.00',
     '9': '0%',
     '10': '0.00%',
     '11': '0.00E+00',
     '12': '# ?/?',
     '13': '# ??/??',
     '14': 'm/d/yy',
     '15': 'd-mmm-yy',
     '16': 'd-mmm',
     '17': 'mmm-yy',
     '18': 'h:mm AM/PM',
     '19': 'h:mm:ss AM/PM',
     '20': 'h:mm',
     '21': 'h:mm:ss',
     '22': 'm/d/yy h:mm',
     '37': '#,##0 ;(#,##0)',
     '38': '#,##0 ;[Red](#,##0)',
     '39': '#,##0.00;(#,##0.00)',
     '40': '#,##0.00;[Red](#,##0.00)',
     '45': 'mm:ss',
     '46': '[h]:mm:ss',
     '47': 'mmss.0',
     '48': '##0.0E+0',
     '49': '@',
     '56': '"上午/下午 "hh"時"mm"分"ss"秒 "',
     '65535': 'General' },
  Props: {},
  Custprops: {} }
I greatly appreciate the effort! But now the `XLSX.readFile()` returned object is just ``` { Sheets: {}, SheetNames: [], Workbook: { Sheets: [] }, SSF: { '0': 'General', '1': '0', '2': '0.00', '3': '#,##0', '4': '#,##0.00', '9': '0%', '10': '0.00%', '11': '0.00E+00', '12': '# ?/?', '13': '# ??/??', '14': 'm/d/yy', '15': 'd-mmm-yy', '16': 'd-mmm', '17': 'mmm-yy', '18': 'h:mm AM/PM', '19': 'h:mm:ss AM/PM', '20': 'h:mm', '21': 'h:mm:ss', '22': 'm/d/yy h:mm', '37': '#,##0 ;(#,##0)', '38': '#,##0 ;[Red](#,##0)', '39': '#,##0.00;(#,##0.00)', '40': '#,##0.00;[Red](#,##0.00)', '45': 'mm:ss', '46': '[h]:mm:ss', '47': 'mmss.0', '48': '##0.0E+0', '49': '@', '56': '"上午/下午 "hh"時"mm"分"ss"秒 "', '65535': 'General' }, Props: {}, Custprops: {} } ```
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#648
No description provided.