#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <string>
// Function to read Excel file and handle blank cells
void readExcelFile(const std::string& filePath) {
std::ifstream inputFile(filePath);
if (!inputFile.is_open()) {
std::cerr << "Error opening file: " << filePath << std::endl;
return;
}
std::string line;
while (std::getline(inputFile, line)) {
std::stringstream ss(line);
std::vector<std::string> cells;
std::string cell;
while (std::getline(ss, cell, ',')) {
cells.push_back(cell.empty() ? "EMPTY" : cell);
}
// Process cells as needed
for (const auto& cellValue : cells) {
std::cout << "[" << cellValue << "] ";
}
std::cout << std::endl;
}
inputFile.close();
}
int main() {
// Specify the path to the Excel file
std::string excelFilePath = "path/to/your/excel/file.csv";
// Call the function to read Excel file
readExcelFile(excelFilePath);
return 0;
}