Skip to content

Bug Report: CSV Viewer does not automatically support Semicolon (;) as a delimiter #5594

@azdfzshffg

Description

@azdfzshffg

Checklist

Version

2.50

Description

Currently, the CsvViewer component relies on the comma (,) as the field delimiter, as implemented in the parseCSV utility function. This causes CSV files that use the semicolon (;) as a delimiter—which is common in many European regions where the comma is used as a decimal separator—to be rendered incorrectly as a single column.

To fix this, the parseCSV function needs to implement a delimiter detection mechanism (or allow configuration) to identify whether the file is using a comma (,) or a semicolon (;).

Here is an example in the screenshot showing a few lines with the comma separator and then lines with the semicolon separator to demonstrate the rendering issue.

Image

Thx

What did you expect to happen?

Introduce a detectDelimiter function that checks the first non-empty line of the CSV content.

Compare the count of commas (,) and semicolons (;) in that line.

Use the character with the higher count as the determined delimiter for the parsing process. If the counts are equal or zero, default to the comma (,).

Update the parsing logic inside parseCSV to use the detected delimiter instead of the hardcoded comma.

What actually happened?

This causes CSV files that use the semicolon (;) as a delimiter—which is common in many European regions where the comma is used as a decimal separator—to be rendered incorrectly as a single column.

Reproduction Steps

This issue can be reproduced simply by viewing any CSV file that uses a semicolon (;) instead of the standard comma (,) as its field delimiter in the CsvViewer.

Create a new file named test_semicolon.csv.

Name;Age;City
Alice;30;Paris
Bob;25;Berlin

Files

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions