Quote Originally Posted by ChrisW67 View Post
Something like:
  • Open file you wish to insert into. QTextStream
  • Open a temporary file to hold the result. QTextStream and QTemporaryFile
  • Loop 10 times reading a line from the input file and writing it to the output.
  • Read the 11th line from the input
  • Insert the value into the line at character 19. QString::insert() and QString::number()
  • Write the modified line to the output
  • Loop over remaining lines in the input file, writing each to the output file
  • Close both files
  • If there have been no errors copy the temporary file over the original file. QFile::copy()


If the files are small then this can be done by reading the entire file into a QStringList, manipulating it in memory, then writing the result. There is more than one way to do this.
Thanks a lot. Can you explain more detail how to use these command to make code? I am newbie.