Results 1 to 2 of 2

Thread: Reading of a Particular line & replacing its text after particular character

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #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: Reading of a Particular line & replacing its text after particular character

    It is not possible to "replace" a line in file (unless the replacement has exactly the same number of bytes as the part being replaced) and neither it is possible to "insert" a line in the middle of a file. If you need something like this, you have to rewrite every successive byte of the file. So it's usually easier to just read the file to memory, modify it there and then write everything back.
    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.


  2. The following user says thank you to wysota for this useful post:


Similar Threads

  1. QRegExp not reading literal character '-'
    By jshafferman in forum Qt Programming
    Replies: 5
    Last Post: 17th April 2012, 15:53
  2. Reading a text line per line
    By Momergil in forum Newbie
    Replies: 0
    Last Post: 19th July 2011, 15:46
  3. QTextEdit End-of-Line character
    By smhall316 in forum Newbie
    Replies: 1
    Last Post: 29th September 2010, 18:28
  4. Image reading and writing line by line
    By Astrologer in forum Qt Programming
    Replies: 7
    Last Post: 29th April 2010, 08:15
  5. Character by Character (Unicode?) File Reading
    By mclark in forum Qt Programming
    Replies: 4
    Last Post: 22nd April 2009, 15:28

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.