kima2/src/core/excelreader.cpp

27 lines
623 B
C++

#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);
const int START_ROW = 5;
const int END_ROW = 350;
int rowCount{};
for (const auto& row : ws.rows(false)) {
// auto test = row[0].value<int>();
if (rowCount < START_ROW) {
rowCount++;
continue;
} else if (rowCount > END_ROW) {
break;
}
std::cout << row[0].value<int>() << "\n";
rowCount++;
}
}