Deleting a line from a text file.

I

id10t error

I am making a program that will take a while to run. What the program
does is read a text file line update some information and then read
the next line. The problem is this program will run at the end of the
night and the user may shut off their computer before this is
finished. How can I read the first record in the file and then delete
the record I just read after I updated some information. I will want
to do this for every record in the file. I want to make sure if the
user shuts off the computer I can start the program on the next file.
Thank you for any help.
 
M

Martin H.

Hello id10t,

You could create a file which contains the file name of the last file
that was read. This way you just read in that file (which just contains
1 file name) and find that file name in the file list. Then, continue
with the next file from the file list.

Best regards,

Martin
 
I

id10t error

Martin,

That is a very good idea. I will look into that and see how i can try
to make that work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top