Please nominate your Qt Champions for 2021! https://forum.qt.io/topic/132134/looking-for-the-2021-qt-champions

[solved] deleting a line



  • i have this txt file:
    "

    lightblue
    erklärung
    Eine erklärung machen
    Spiegazione

    false
    ENDB

    green
    bei

    presso

    false
    ENDB

    green
    bei
    sono nei pressi
    ciao

    true
    ENDB

    green
    wort
    das ist es
    parola
    questo è
    false
    ENDB

    "

    how can i delete a part of it, for example the following?
    "green
    bei

    presso

    false
    ENDB"



  • Load it into memory, delete the content from the String in the memory and stroe it again. Directly deleting in the file is not possible.



  • If content is newline delimited, load it to QStringList and delete required items.


Log in to reply