This may seem a stupid question but I didn't find an ansewer to it...
I'd like to insert lines of data in a .txt file that already contains data.
I tried with fprintf() , helped by fseek() to place the cursor at the beginning of the file for example, but the problem is that when fprintf() writes data in the file, it replaces the data of the file by the data to be written.
(the file has previously been opened wtih fopen(fid,'r+'))
What I'd like to do is inserting my new data, just like I would do if I write my new data at the beginning of the file, remaining the previous data in the following lines.
I also checked if I made an error of the permission of fopen, but it seems that there's no other way to open than r, r+, a, a+, w, ... but no one does what I want ...
Help please.... I need quick help.... please
Rolando
I'd like to insert lines of data in a .txt file that already contains data.
I tried with fprintf() , helped by fseek() to place the cursor at the beginning of the file for example, but the problem is that when fprintf() writes data in the file, it replaces the data of the file by the data to be written.
(the file has previously been opened wtih fopen(fid,'r+'))
What I'd like to do is inserting my new data, just like I would do if I write my new data at the beginning of the file, remaining the previous data in the following lines.
I also checked if I made an error of the permission of fopen, but it seems that there's no other way to open than r, r+, a, a+, w, ... but no one does what I want ...

Help please.... I need quick help.... please
Rolando