Excel file - loop crashout - c++
-
Hey, I've got an unusual one today. I am trying to iterate through a list of cities in excel. have been using the LibXL library without any issues thus far. However for some reason if I want to iterate through 2824 rows everything crashes out. The code works for an iteration of 200 but not more. doesn't really matter which 200 indexes in between 1 and 2825, just always crashes out.
It's a simple loop, nothing much. I thought that maybe the fact that I'm using readStr() makes it consume way more memory so I simplified it just to read it and not store it. same thing. At first I tried a manual way of catching a match (strcmp()) but even if I use an unordered map it doesn't work.
Please help :)Book* book = xlCreateBook(); book->load("file.xls"); book->setLocale("UTF-8"); Sheet* sheet = book->getSheet(0); unordered_map<string, string> mp; for(int i = 1; i < 2826; i++) { mp.insert({std::string(sheet->readStr(i, 6)), std::string(sheet->readStr(i, 3))}); } -
Hey, I've got an unusual one today. I am trying to iterate through a list of cities in excel. have been using the LibXL library without any issues thus far. However for some reason if I want to iterate through 2824 rows everything crashes out. The code works for an iteration of 200 but not more. doesn't really matter which 200 indexes in between 1 and 2825, just always crashes out.
It's a simple loop, nothing much. I thought that maybe the fact that I'm using readStr() makes it consume way more memory so I simplified it just to read it and not store it. same thing. At first I tried a manual way of catching a match (strcmp()) but even if I use an unordered map it doesn't work.
Please help :)Book* book = xlCreateBook(); book->load("file.xls"); book->setLocale("UTF-8"); Sheet* sheet = book->getSheet(0); unordered_map<string, string> mp; for(int i = 1; i < 2826; i++) { mp.insert({std::string(sheet->readStr(i, 6)), std::string(sheet->readStr(i, 3))}); }