Before I go into a specific example of an application, let me explain how accessing a flat-file database works in general. There are four operations that you might want to perform—reading a record, adding a record, deleting a record, and modifying a record. Let’s look at the steps required to perform each of these operations.
Find some information that will allow you to identify the record or records you need to retrieve.
Open the file in which the data is stored.
Search through all the records in the file until you find the ones that match the information you’re looking for.
Copy the data from the file into a data structure that can be accessed from within your program.