×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jan 2008
    Posts
    48

    Arrow Shifting a line in QFile

    I have to append a string at the middle of the file. Does anybody can help me on this?



    Example: I have a gpassword.txth file created by QFIle.

    My password.txt file having the following data



    Line No 1: BIRTHDAY

    Line No 2: 1

    Line No 3: PERSONAL

    Line No 4: 1

    Line No 5: XYZ

    Line No 6: 1



    Now I have to append a string at the middle (LINE No 4), how to shift the 1 and add the string.

  2. #2
    Registered User
    Join Date
    Dec 2006
    Posts
    2,280

    Re: Shifting a line in QFile

    Hi,

    If your file is not very big then you can read the entire contents into a string or byte array and insert the necessary data, then write the new larger string back to the file (overwriting previous contents).

    Mark

  3. #3
    Nokia Developer Moderator
    Join Date
    May 2007
    Posts
    468

    Re: Shifting a line in QFile

    Hi,
    for Qt API related topics please check also http://www.qtcentre.org/forum/

    It has lot's of good discussion about using Qt APIs.

    Cheers,
    Jack

Similar Threads

  1. i cant build helloworld project
    By akhin in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 2
    Last Post: 2008-12-22, 12:38
  2. [moved] HELP! Phone Debug (GCCE)
    By joseph.m in forum Symbian
    Replies: 18
    Last Post: 2008-07-14, 10:42
  3. carbidec++ helloworld project problem
    By akhin in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 0
    Last Post: 2007-03-11, 12:40
  4. carbide build problem help please
    By berkcekisbas in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2006-09-26, 19:41

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •