30 static inline QVector<QStringList> readCSVasColumns(
const QString &filename)
32 QFile csvfile(filename);
33 csvfile.open(QIODevice::ReadOnly);
34 QTextStream stream(&csvfile);
36 QVector<QStringList> values;
39 QString line = stream.readLine();
40 auto items = line.split(
",");
41 for (
int i = 0; i < items.length(); i++) {
43 list.append(items[i]);
47 while (!stream.atEnd()) {
48 QString line = stream.readLine();
49 auto items = line.split(
",");
50 for (
int i = 0; i < values.length(); i++) {
51 values[i].append(items[i]);
62 static inline QVector<QStringList> readCsvAsRows(
const QString &file_name)
64 QFile csvfile(file_name);
65 csvfile.open(QIODevice::ReadOnly);
66 QTextStream stream(&csvfile);
68 QVector<QStringList> csv_rows;
71 while (!stream.atEnd()) {
72 const QString line = stream.readLine();
73 csv_rows.append(line.split(
','));