Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Writting blocks of data in TextFile
Babs last edited by Babs
What is the easiest way to write repetitive blocks of data into a Text file.
For example a structure like this:
EVENEMENT INSTANT = 32 ENTREES E19 = FAUX E20 = FAUX FIN EVENEMENT INSTANT = 34 ENTREES E21 = FAUX E22 = FAUX FIN EVENEMENT INSTANT = 36 ENTREES E21 = VRAI E22 = FAUX FIN EVENEMENT INSTANT = 38 ENTREES E23 = FAUX E24 = FAUX FIN EVENEMENT INSTANT = 40 ENTREES E23 = FAUX E24 = VRAI FIN
This data is read from an excel file.
gde23 last edited by
Just write it to the file. Or what exactly is the question?
@gde23 I want add each block automatically not write manually every single line.
Where are the data coming from ?
@SGaist the data is coming from a complex excel file
So you have to read them from that Excel file, do some processing and write the result to a text file ?
JonB last edited by JonB
So at some level do you want to (use
QTextStreamto) loop reading the lines from the file, do whatever modification appropriate in memory, and write the resultant line back out to a new file? Or, you can read all the lines into a
QListin memory, make all the changes, and write the whole new file back.
@JonB i thougth about using QSettings but my files extensions are not .ini.
@JonB for now i created a QLIst and read the data with QTextStream
What do you put in your QList ?
Can you explain what is the exact issue you are having with writing the content you are reading from the Excel file to another text file ?