32 file.open(
filename, std::ios_base::in);
38 header =
Split(line, separator);
49 row =
Split(line, separator);
61 std::vector<std::string> rowStr =
Split(line, separator);
62 for (
const std::string&
s : rowStr)
77 std::vector<std::string> rowStr =
Split(line, separator);
78 for (
size_t i = 0; i < rowStr.size() && i < header.size(); i++)
80 row[header.at(i)] =
toFloat(rowStr.at(i));
87 std::vector<std::vector<float> >
data;
88 std::vector<float> row;
98 std::vector<std::map<std::string, float> >
data;
99 std::map<std::string, float> row;
109 std::map<std::string, std::vector<float> >
data;
110 std::vector<float> row;
113 for (
size_t i = 0; i < row.size() && i < header.size(); i++)
115 data[header.at(i)].push_back(row.at(i));
132 bool CsvReader::readLine(std::string& line)
134 return static_cast<bool>(std::getline(file, line));