ex00: fix: input header

This commit is contained in:
Camille Chauvet 2023-10-04 12:10:16 +00:00
parent 1073961a76
commit 9b45aa4951
2 changed files with 1614 additions and 1 deletions

1613
ex00/data.csv Normal file

File diff suppressed because it is too large Load Diff

View File

@ -80,7 +80,7 @@ static int check_value(const std::string& value_str, int flag, float& out)
static int check_line(const std::string& line, regex_t& reegex, const std::string& delimiter, int flag, std::pair<unsigned int, float>& out) static int check_line(const std::string& line, regex_t& reegex, const std::string& delimiter, int flag, std::pair<unsigned int, float>& out)
{ {
if (line == "date" + delimiter + "exchange_rate") if (line == std::string("date") + delimiter + std::string(flag == DATABASE ? "exchange_rate" : "value"))
return 1; return 1;
if (regexec(&reegex, line.c_str(), 0, NULL, 0) == REG_NOMATCH) if (regexec(&reegex, line.c_str(), 0, NULL, 0) == REG_NOMATCH)
{ {