PapaParse icon indicating copy to clipboard operation
PapaParse copied to clipboard

Parsing two-column csv with semi-column separator is not detected

Open FranciscoGileno opened this issue 1 year ago • 1 comments

Steps to reproduce: Go to: https://www.papaparse.com/demo Try to parse this string:

feedback_event;feedback_time
verified;1708657810

OBS: The third line is empty (If we remove the third-line, it works) This is the same as:

feedback_event;feedback_time\nverified;170865781023\n

OBS: Usually the editors add this \n in the end of the last line.

Parameters:

Delimiters: 'auto',
Preview: 1

Results:

{
    "data": [
        {
            "feedback_event;feedback_time": "verified;1708657810"
        }
    ],
    "errors": [
        {
            "type": "Delimiter",
            "code": "UndetectableDelimiter",
            "message": "Unable to auto-detect delimiting character; defaulted to ','"
        }
    ],
    "meta": {
        "delimiter": ",",
        "linebreak": "\n",
        "aborted": false,
        "truncated": true,
        "cursor": 49,
        "fields": [
            "feedback_event;feedback_time"
        ]
    }
}

Expected results: Should parse the string and detect the ; as delimiter

OBS:

  1. If the CSV has three or more columns, it works
  2. If the two-column CSV has , as delimiter, it works.

FranciscoGileno avatar Feb 23 '24 15:02 FranciscoGileno

Run into the same issue today. Thanks for reporting it!

happyfloat avatar Jun 19 '24 11:06 happyfloat