PDA

View Full Version : delete first row of data from .csv file?



babymonsta
19th May 2010, 05:58
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

aamer4yu
19th May 2010, 06:11
you can delete in a string,, can you ?
then just save the remaining text with the same csv filename..

squidge
19th May 2010, 09:28
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.

babymonsta
20th May 2010, 03:39
i got the idea, thanks guys!