Saving from one txt file into another one problem?
-
Hello everyone, I need some idea since I am running out of my own and haven't been able to get it working. I have a file called temp.txt which hold temparary data and will be deleted at the end of the Windows Application life. I have another file called perm.txt which is similar to the temp.txt file but it hold the saved data. In order to avoid multipler data registration I would like to check to see if a particular data from temp.txt file has already been registered or not. If it hasn't then I will go ahead to save/register it into save.txt file. That is if the user choses to Save its temp.txt content by clicking on the SAVE button. Any suggestion in this issue will be greatdly appriciated. Thank you very much and have a great day. Khoramdin
-
Hello everyone, I need some idea since I am running out of my own and haven't been able to get it working. I have a file called temp.txt which hold temparary data and will be deleted at the end of the Windows Application life. I have another file called perm.txt which is similar to the temp.txt file but it hold the saved data. In order to avoid multipler data registration I would like to check to see if a particular data from temp.txt file has already been registered or not. If it hasn't then I will go ahead to save/register it into save.txt file. That is if the user choses to Save its temp.txt content by clicking on the SAVE button. Any suggestion in this issue will be greatdly appriciated. Thank you very much and have a great day. Khoramdin
-
Hello everyone, I need some idea since I am running out of my own and haven't been able to get it working. I have a file called temp.txt which hold temparary data and will be deleted at the end of the Windows Application life. I have another file called perm.txt which is similar to the temp.txt file but it hold the saved data. In order to avoid multipler data registration I would like to check to see if a particular data from temp.txt file has already been registered or not. If it hasn't then I will go ahead to save/register it into save.txt file. That is if the user choses to Save its temp.txt content by clicking on the SAVE button. Any suggestion in this issue will be greatdly appriciated. Thank you very much and have a great day. Khoramdin
I don't quite understand the problem/question. As I understand the situation: You save data in a temporary file which is deleted when the application exits. There is another permanent file where the data in the temporary file is written/moved as long at the data doesn't already exist in the permanent file. This would require your code to perform the following: Read a record from the temporary file. Read the contents of the permanent file searching for a matching record. If no record is found in the permanent file, append the permantent file with the new record. Depending on the size of the files and number of records, you may be able to read both files into memory when making comparisons and after any additions, simply write out a new permanent file from the records in memory.
Regards Wayne Phipps ____________ Time is the greatest teacher... unfortunately, it kills all of its students View my Blog
-
Hello everyone, I need some idea since I am running out of my own and haven't been able to get it working. I have a file called temp.txt which hold temparary data and will be deleted at the end of the Windows Application life. I have another file called perm.txt which is similar to the temp.txt file but it hold the saved data. In order to avoid multipler data registration I would like to check to see if a particular data from temp.txt file has already been registered or not. If it hasn't then I will go ahead to save/register it into save.txt file. That is if the user choses to Save its temp.txt content by clicking on the SAVE button. Any suggestion in this issue will be greatdly appriciated. Thank you very much and have a great day. Khoramdin
In addition to what Wayne Phipps said, I'd suggest that you store the records as Hash codes in a HashTable. This way you can compare small integers instead of large records, which could boost your performance dramatically.
Regards:rose: