-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Description
Checklist
- This is a bug report, not a question.
- I have searched on the issue tracker for my bug.
- I am running the latest FileBrowser version or have an issue updating.
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.
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