Unexpected behavior in the `sheet_to_csv` utility function
rmitra-chub opened this issue · comments
There's a possible bug in the utils.sheet_to_csv
function (https://docs.sheetjs.com/docs/api/utilities#delimiter-separated-output)
Function arguments:
- sheet =>
{ A1: { v: "sample header 1", t: "s", w: "sample header 1", }, B1: { v: "sample header 2", t: "s", w: "sample header 2", }, A2: { v: "\"sample text 1", t: "s", w: "\"sample text 1", }, B2: { v: "sample text 2", t: "s", w: "sample text 2", }, "!ref": "A1:B2", }
- options =>
{ FS: '\t' }
Output: "sample header 1\tsample header 2\n"""sample text 1"\tsample text 2\n"
Expected Output: "sample header 1\tsample header 2\n"sample text 1\tsample text 2\n"
The output is duplicating the double quote if there is one inside one of the values (in this example, A2).