Results 1 to 2 of 2

Thread: how to delete all data in text file?

  1. #1
    Join Date
    Nov 2010
    Posts
    31
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Question how to delete all data in text file?

    thanh in advance!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: how to delete all data in text file?

    Qt Code:
    1. QFile file("file");
    2. file.open(QFile::WriteOnly|QFile::Truncate);
    To copy to clipboard, switch view to plain text mode 
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 8
    Last Post: 8th May 2012, 09:39
  2. Insert data in a text file
    By korwin in forum Newbie
    Replies: 7
    Last Post: 15th July 2011, 02:48
  3. Problem: Reading and editing text file data
    By dipeshtech in forum Newbie
    Replies: 2
    Last Post: 2nd May 2011, 23:47
  4. delete first row of data from .csv file?
    By babymonsta in forum Qt Programming
    Replies: 3
    Last Post: 20th May 2010, 03:39
  5. How to query data by id in a text file
    By SamSong in forum Qt Programming
    Replies: 4
    Last Post: 26th May 2009, 10:58

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.