kima2/src/core/excelreader.cpp

27 lines
623 B
C++
Raw Normal View History

2018-08-01 15:36:41 +02:00
#include "excelreader.h"
#include <xlnt/xlnt.hpp>
void ExcelReader::readSellersFromFile(const std::string& filename, Marketplace* market)
{
xlnt::workbook wb;
wb.load(filename);
auto ws = wb.sheet_by_index(0);
2018-08-02 11:15:15 +02:00
const int START_ROW = 5;
const int END_ROW = 350;
2018-08-01 15:36:41 +02:00
2018-08-01 15:55:13 +02:00
int rowCount{};
2018-08-01 15:36:41 +02:00
for (const auto& row : ws.rows(false)) {
2018-08-01 15:55:13 +02:00
// auto test = row[0].value<int>();
2018-08-02 11:15:15 +02:00
if (rowCount < START_ROW) {
rowCount++;
2018-08-01 15:55:13 +02:00
continue;
2018-08-02 11:15:15 +02:00
} else if (rowCount > END_ROW) {
break;
}
std::cout << row[0].value<int>() << "\n";
2018-08-01 15:55:13 +02:00
rowCount++;
2018-08-01 15:36:41 +02:00
}
2018-08-01 15:55:13 +02:00
}