I am working on B&S assignment.I understood the file format and i have printed the start of the file and the schema description and also the first record.But how do I know in advance how many records are there in the file.Thanks for your reply and your time
how do I know in advance how many records are there in the file.
- read the start of data section or the location of first record in the database and put it in dbStart integer variable.
- read the length of the hole file and put it in dbFileLength integer variable.
- In advance you know the size of the one record. as you calculate this size during the looping on the fields name and size of each field, so put the size of one record in recordSize integer variable.
- So numOfRecordInDB = (dbFileLength - dbStart) / recordSize; .......... ;-)