how to find a string in a excel file with qt?
-
I don't know how to do it.
-
@mohsen_yadik
you have xlsx file and want to search string from qt?
I'm sorry but I do not understand what you want. -
- I don't know how to do it.
Which part of it ?
The sample loops over cells.
All that is left is to compare string?Why did you try so far, please show some code
-
Thanks for help me.
with your guide was done.
Thank you -
@Beemaneni-Bala-0
Hi
Can other tool open the zip file ? -
@Beemaneni-Bala-0
The excel file (XLSX) is actually a zip file.
Do you try to give it an old binary format ?
what is the extension of the file? -
@mrjj Here is the code snipped . I need to just read an excel file here. i am using linux machine here and i can open excel file using libreoffice
void MainWindow::readExcelFile(QString excelSheetFile){ QXlsx::Document xlsx("ExcelSheet.xlsx"); qDebug()<<xlsx.read("A1"); qDebug()<<xlsx.read("A2"); qDebug()<<xlsx.read("A3"); qDebug()<<xlsx.read("A4"); qDebug()<<xlsx.read("A5"); qDebug()<<xlsx.read("A6"); qDebug()<<xlsx.read("A7"); for (int row=1; row<10; ++row) { qDebug()<<"Row No : "<<row << xlsx.cellAt(row, 1); if (QXlsx::Cell *cell=xlsx.cellAt(row, 1)) qDebug()<< "Cell Data: " << cell->value(); } }
-
Hi
and the file is indeed an xlsx and not the old xls `?
The file you give it, excelSheetFile
Else convert it with libreOffice