delete data in file

M

Magix

Hi,

let say I have test.dat with following entry:

***********
string1 string2
string3
***********
string4 string5
string6
***********
string7 string8
string9

I would like to delete the first entry (when find the first ***********),
which is:
***********
string1 string2
string3

so that the test.dat will only have:
***********
string4 string5
string6
***********
string7 string8
string9

I don't want to use the solution of copying to a temp buffer/ temp file,
then rewrite the test.dat.
If you have other better solution, let me know. If manipulate directly with
test.dat, will be the best.

Thanks.
 
H

Harti Brandt

On Mon, 5 Jul 2004, Magix wrote:

M>Hi,
M>
M>let say I have test.dat with following entry:
M>
M>***********
M>string1 string2
M>string3
M>***********
M>string4 string5
M>string6
M>***********
M>string7 string8
M>string9
M>
M>I would like to delete the first entry (when find the first ***********),
M>which is:
M>***********
M>string1 string2
M>string3
M>
M>so that the test.dat will only have:
M>***********
M>string4 string5
M>string6
M>***********
M>string7 string8
M>string9
M>
M>I don't want to use the solution of copying to a temp buffer/ temp file,
M>then rewrite the test.dat.
M>If you have other better solution, let me know. If manipulate directly with
M>test.dat, will be the best.

With only standard-C available the only way is to rewrite the file.

harti
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top