Im working with XML files in Qt, and i need to copy an XML file and then append to the copy. One issue im having is i need to delete the very last line of the XML file which is:
</VSCommands>
I am very new to working with XMLs in Qt and using QDom, so im here asking for help on what is the best way to approach copying the xml file, and deleting that last line, then appending my new data to the end of the file?
Edit: I have copied the original xml to a new xml using:
QFile readFile(filename);
readFile.copy(new_filename);
QFile writeFile(new_filename);
And now i have opened it to append onto the file with:
if (writeFile.open(QIODevice::Append))
{
}
I am just unsure of how to delete the last line of the file first, before i begin to append the new data.