Skip to content

Commit

Permalink
Newlines at end of strings are unexpected
Browse files Browse the repository at this point in the history
  • Loading branch information
mo42 committed Nov 4, 2024
1 parent 47bca32 commit 134d80b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/DataFrame/Internals/DataFrame_read.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -1153,6 +1153,12 @@ read_csv2_(std::FILE *stream,
}
}
else if (col_spec.type_spec == "string") {
if (!value.empty() && value.back() == '\n') {
value.pop_back();
}
if (!value.empty() && value.back() == '\r') {
value.pop_back();
}
std::any_cast<StlVecType<std::string> &>
(col_spec.col_vec).emplace_back(value);
}
Expand Down

0 comments on commit 134d80b

Please sign in to comment.