Lamair Research or X-Plane reads the file to verify integrity when you start the program. If it's wrong they give a message of corrupted file and exit to the Desktop.
<snip>
There are 35,000+ airports, Seaplane bases and Helipads. The only way I would feel comfortable with this approach is to beak each out in a separate file: F00001.txt, F00002.txt . . .F35187.txt.
Breaking the large file into separate files will make update and maintenance of your program rather cumbersome. If you do that, every time there is a new version of the file, you'll have to break it into separate files for your program to use them. That's a headache you don't want.
You should do it the way Lamair research is doing it, which most likely is, they map (CreateFile/CreateFileMapping/MapViewOfFile) the file, which is extremely quick, then scan it to ensure it is as required. On your machine, scanning the file would most likely not even be noticeable.
If I knew of a Lazarus component that does that (map the file for you), I would suggest it but, I know next to nothing about what components are available, much less what they do. Hopefully someone else can fill that gap.
In your case, your first step would be the same, create a file mapping of the file, the second step would be to scan the file to create an array of pointer indexes based on whatever information you want to show (the "filter" box in wp's example.) This second step, you do it using the technique wp posted an example for in this thread, that is using a component such as VTV (which wp used) so you don't copy thousands (or more) strings into the component that displays them.
You can keep the code very simple if you scan the file twice. The first scan to determine how many records/lines you need to keep track of, which would allow you to set the length of the dynamic array upfront before you proceed to load it with the pointers to the strings/lines. The second scan to load the array. That keeps memory management as simple as it gets.
The basic concept is very simple, you load the file into memory (mapping it is the fastest way also, memory efficient if you set it to PAGE_READONLY) then, create an index based on what the user (you in this case) wants to look at (as wp's example does.)
On your machine, the above would happen in less than the blink of an eye.
HTH.
ETA:correction: the component wp used is a ListView placed in virtual mode, not VTV. See wp's post below for full detail.