diff --git a/src/core/parser/csv_parser/csv_parser.cpp b/src/core/parser/csv_parser/csv_parser.cpp index 360a53803b..c0e0107f96 100644 --- a/src/core/parser/csv_parser/csv_parser.cpp +++ b/src/core/parser/csv_parser/csv_parser.cpp @@ -97,6 +97,16 @@ void CSVParser::GetLine(unsigned long long const line_index) { void CSVParser::GetNextIfHas() { has_next_ = !source_.eof(); + + /* Check for the last newline */ + if (has_next_) { + source_.get(); + if (source_.eof()) { + has_next_ = false; + } + source_.unget(); + } + if (has_next_) { GetNext(); }