-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCSVReader.hpp
More file actions
27 lines (22 loc) · 729 Bytes
/
Copy pathCSVReader.hpp
File metadata and controls
27 lines (22 loc) · 729 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef CSVREADER_HPP
#define CSVREADER_HPP
#include <vector>
#include <string>
class CSVReader {
private:
std::string filename;
char delimiter;
int numVariables;
std::vector<std::string> variableNames;
std::vector<std::vector<std::string>> data;
void readHeader();
void readData();
public:
CSVReader(std::string filename, char delimiter=',');
int getNumVariables() const;
std::vector<std::string> getVariableNames() const;
std::vector<std::string> getLine(int lineNumber) const;
int getNumLines() const;
float getMaxValue(int *excludeColumns = NULL, int numExcludeColumns = 0) const;
};
#endif // CSVREADER_HPP