I'm reading 8,000,000+ records out of a text file into a listbox. But I only need to examine 78,000 plus or minus. The rest I just throw on the floor.
Of the 78,000 record I need 3 pieces of data.
1 ICAO Airport Example: KLAX, EGGE KJFK
2 Latitude of the airport.
3 Longitude of the airport.
Several gotcha along the way.
The Lat and Lon may be in a "1302 data_lat" or a 1302 data_lon.
They would look like this in the file.
1302 data_lat 32.15477889
1302 data_lon -14.25897456
Problem is there are version of of this file so the 1302 data_lat and 1302 dat_lon might be there but empty.
So you try and get the location of the Tower. It may have a Lat/Lon and may not.
Finally you go for the center line of one of the runways. That is required. Can be a couple miles off in really big airports. But if you land the plane 2 miles east of Gatwick on a city street who's gonna complain.
Now here is what i'm doing:
Step 1: (Done)
I read the 8 million saving off in listboxs1
RecType 1 Airport ICAO,
14 Tower
16 Seaplane Base
17 Helicapoter pad
100 Runway(s)
The last record in the file is 99.
So starting at the last record I read backwards looking for a Record type 1, 16 or 17 loading them into listbox3 as i go. Once loaded I can parse out my data based on the record type format a record to go into Listbox2 that looks like:
KLAX 45.254879 -124.24587
Should be about 35,000 of those but with them I can calculate anywhere to anywhere.
Step 2: (Trouble)
After Processing a screen of data from listbox3 to listbox2 I would like to delete them from listbox1.
I either get out of bounds error or it wont delete them.
Step 3: (Done Untested)
Write Listbox2 to a file.