I have a large file with variable length records. The data was written sequentially with a field length prefixed to the start of the record.
I want to write an application which can seek/search this file for a specific tag/content.
I am having trouble developing an alogrithm to search the file. If the records were fixed length I could easily develop a binary-chop or something similar which calculates the position by offset and record length.
But how can I randomly seek within a variable length record collection? I would have trouble identifying what was data and record length...
Perhaps I should try and read and encode the file into another format first?
Bookmarks