Skip to content

Commit

Permalink
bugfix: replace newlines with _ in CSV cell values (#5656)
Browse files Browse the repository at this point in the history
* bugfix: replace newlines with _ in CSV cell values

* replace newlines with spaces
  • Loading branch information
shun2wang authored and JorisGoosen committed Sep 30, 2024
1 parent faa4849 commit e80ff5f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Desktop/data/importers/csv/csv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@ bool CSV::readLine(vector<string> &items)
for (size_t index = 0; index < items.size(); index++)
{
string item = items.at(index);
boost::algorithm::replace_all(item, "\n", " "); // so we should not allow newlines in values right?
if (item.size() >= 2 && item[0] == '"' && item[item.size()-1] == '"')
item = item.substr(1, item.size()-2);
items[index] = item;
Expand Down

0 comments on commit e80ff5f

Please sign in to comment.