Results 1 to 4 of 4

Thread: delete first row of data from .csv file?

  1. #1
    Join Date
    Mar 2010
    Posts
    13
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default delete first row of data from .csv file?

    I have a .csv file which I would like to write my program to read the first row of data and print it out and then delete that row of data, then read the next row and repeat. I'm able to do everything except the part of deleting a row in the .csv file. I tried google-ing but have not found any solutions. Can any one tell me how can I delete the first row of data from the .csv file?

    Thanks

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: delete first row of data from .csv file?

    you can delete in a string,, can you ?
    then just save the remaining text with the same csv filename..

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

    babymonsta (20th May 2010)

  4. #3
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: delete first row of data from .csv file?

    Open the file for reading. Ignore the first line, copy the rest of the lines to another file, then delete the old file and rename the new file to the old name.

  5. The following user says thank you to squidge for this useful post:

    babymonsta (20th May 2010)

  6. #4
    Join Date
    Mar 2010
    Posts
    13
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: delete first row of data from .csv file?

    i got the idea, thanks guys!

Similar Threads

  1. Delete character from file
    By kaszewczyk in forum Newbie
    Replies: 2
    Last Post: 11th March 2010, 18:07
  2. Replies: 4
    Last Post: 16th January 2010, 10:08
  3. delete a single file from a directory
    By rishiraj in forum Newbie
    Replies: 1
    Last Post: 12th March 2009, 05:46
  4. how to delete a file?
    By whoops.slo in forum Qt Programming
    Replies: 4
    Last Post: 22nd November 2006, 14:27
  5. How to delete File
    By rajesh in forum Qt Programming
    Replies: 1
    Last Post: 7th November 2006, 11:23

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.