Click to See Complete Forum and Search --> : how to delete data from the file


yang
April 20th, 1999, 04:00 PM
I had a file here, and I want to go through the data in the file. Some data in the file don't need anymore, and we need delet those data and those related data as well. I want to know hoe to delete those data (and those related data) from the file. Anyone can help me out?
Thank you for your time.
P.S The file is not predefined file, and user could get the file from any directory. I have codes here for browsing the file in the directory (only for your reference)
CString text2 = dlg.m_Text2;
pik_in = fopen(text2, "r");
.
.
.
.

Allen Y
April 20th, 1999, 04:17 PM
Create another temporary file for writting and you will write all the data you want. Then, after reading from the data file, you can rename the temporary file to the data file. Hope this will give you some hints. Good luck.

Allen

yang
April 20th, 1999, 07:42 PM
thank you for your respond. Do you think you can show me how to really create a temp file and put data into the temp file?