You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think the result should be trimmed from both sides.
Because sometimes even data inside the same file is inconsistent.
In most cases, CSV files have data separated by commas, TSV files separate it by tabs.
But then some people add extra spaces:
Oleks, 25, true
And others don't:
Oleks,25,true
It can be even more troublesome when there are tabs and the space can be invisible.
And then the users will be running into all kinds of problems.
For example, when ' 25' can not be parsed as a number because there is a space.
So I think that it's better to trim whitespace characters from left and right when reading from a CSV.
(but only unless quotes are used! Because if a file contains something like "Oleks", " 25 " then maybe clients want those spaces inside quotes)
The following line of a CSV file:
Will be parser as:
#('first_name' ' last_name' ' order_date' ' amount')
(with each string except the first one starting with a space).
Spaces after commas in CSV files should be ignored
The text was updated successfully, but these errors were encountered: