mgcrea / node-xlsx

NodeJS excel file parser & builder
Other
2.96k stars 274 forks source link

Strange behaviour when parsing CSV with [Number Comma Number] in string values #125

Closed rkahle closed 4 years ago

rkahle commented 5 years ago

When parsing this CSV using "sheet_to_json" method:

ISIN;WKN;Name;Art;
DK0060738599;A2AKB9;DEMANT AS A        DK 0,2;AKTIE;

I get this result with option "raw: false":

{ "ISIN": "DK0060738599",
  "WKN": "A2AKB9",
  "Name": "2/1/00",
  "Art": "AKTIE" }

and this result with option "raw: true":

{ "ISIN": "DK0060738599",
  "WKN": "A2AKB9",
  "Name": 36557.041666666664,
  "Art": "AKTIE" }

The problem is the "Name" field. With "raw: false" it is parsed to something looking like a date, and with "raw: true" it is parsed to some float value... Is there any way to just keep the value of the field as is, not parsing it anyhow?

Thanks for your help!

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.