This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
If you open the file with TextPad, you will see that the record number is not in the file. I am just assigning a "temporary" record number at run time based on position. The 1st record is 0, and so on. Even though you can't directly access them, in my implementation, deleted records get a record number too, which are not really deleted, just marked as invalid, count as a record. So if record 2 is valid, then the next record is invalid, followed by a valid number, the record number for the next valid record is 4.