Well this is a specific requirement and our objective is that we need to write a restart able batch that should pick from where it left processing records last time My intention is that to mark all the processed records by a # delimiter either at the end or beginning of record so that next time I would ignore if that delimiter is present. Regards, Prakash
----- Original Message ---- From: Brett McCoy <[EMAIL PROTECTED]> To: [email protected] Sent: Friday, February 1, 2008 2:18:40 AM Subject: Re: [c-prog] Re: Insert record in text file On Jan 31, 2008 3:39 PM, Nico Heinze <[EMAIL PROTECTED] net> wrote: > Nope. Text files are text files, so you can write (without huge > effort) only from beginning to end. > > What you would like to do is a so-called random-access; nothing to be > done with text files. Random-access files are _usually_ handled by > using open() and read() and write() or fopen(..., "rb+") and the like. > Implementing random access on text files requires huge buffering efforts. Unless you have a specific need for dealing with random access files, you might as well take the leap and use some kind of database management system, even just a lightweight one like SQLIte (http://www.sqlite. org/). It'll look better on your resume also :-) -- Brett ------------ --------- --------- --------- --------- --------- - "In the rhythm of music a secret is hidden; If I were to divulge it, it would overturn the world." -- Jelaleddin Rumi ____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs [Non-text portions of this message have been removed]
