Created
August 26, 2017 15:53
-
-
Save chris-b1/b49e43536938826d14c8340b808ed05f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <chrono> | |
#include "xlnt/xlnt.hpp" | |
#include "xlnt/workbook/streaming_workbook_reader.hpp" | |
int main() | |
{ | |
auto start = std::chrono::system_clock::now(); | |
xlnt::streaming_workbook_reader wb; | |
wb.open("C:/Users/Chris/floats.xlsx"); | |
wb.begin_worksheet("Sheet1"); | |
std::vector<double> values; | |
while (wb.has_cell()) | |
{ | |
auto cell = wb.read_cell(); | |
if (cell.row() > 1) { | |
values.push_back(cell.value<double>()); | |
} | |
} | |
auto end = std::chrono::system_clock::now(); | |
auto dur = std::chrono::duration_cast<std::chrono::milliseconds> (end - start); | |
std::cout << "Reading took " << (float)dur.count() / 1000 << '\n'; | |
std::cout << values.size(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment