Serial File
- This is the simplest type of file structure.
- In a serial file structure, the records are stored one after the other without any logical order.
- In case of new records need to be added to the file, they are appended to the end of the file.
Sequential File
- A sequential file is a serial file that has been given a logical order. The order of records in a sequential file is usually by key field.
Deleting records from Sequential File
open the file for input
open a new file for output
read a record from the file
while there are more records to read
if the record is the one to be deleted
do nothing
else
write the record to the new file
end if
read another record from the file
end while
close the file
close the new file