in reply to how to update a field of a record in a large text file
Otherwise, you would have to read in the file on a record-by-record basis (saving them immediately in a temporary file), until you reach the record you need, parse out the fields of that record, change the field, save this record and then reading and saving all remaining records. Delete the original file and rename the temporary file to the original name.
Attention: only one process/user can access the file at a time, so you will have to take care of locking the file while you are using it or otherwise "Bad Thing Will Happen". It is one of the benefits of using a database that you don't have to take care of that issue.
CountZero
"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law
|
|---|