Results 1 to 2 of 2

Thread: Modifying file with Qt

  1. #1
    Join Date
    Apr 2009
    Posts
    12
    Thanks
    2
    Qt products
    Qt4

    Default Modifying file with Qt

    Hi,

    I need to read certain text from a file, and "remember" the line (nLine) where that text is found in the file. Then on the next line (nLine+1) I need to insert other line of text. I can make copy out of the file and then remove (delete) the "older" and rename the new file, but that is not applicable atm. Is there any way to do "real-time" search/modify for a text in a file?

    thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Modifying file with Qt

    Is there any way to do "real-time" search/modify for a text in a file?
    Yes there is.
    RTFM:
    QFile
    QTextStream
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. The following user says thank you to high_flyer for this useful post:

    afail (14th December 2009)

Similar Threads

  1. QFtp:upload file to server
    By ensky_cy in forum Qt Programming
    Replies: 6
    Last Post: 14th December 2009, 10:42
  2. Double Clicking Pro File
    By BalaQT in forum Installation and Deployment
    Replies: 2
    Last Post: 18th November 2009, 05:23
  3. Read binary from file
    By weldpua2008 in forum Newbie
    Replies: 2
    Last Post: 3rd April 2009, 23:50
  4. Set up the Qt4.3.2 with Visual Studio 2005
    By lamoda in forum Installation and Deployment
    Replies: 6
    Last Post: 30th January 2008, 06:51
  5. qt-3.3.8 fail in scratchbox
    By nass in forum Installation and Deployment
    Replies: 0
    Last Post: 25th May 2007, 15:21

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.