1.

Solve : Batch file for flight schedule?

Answer»

Can someone offer advice on what variables need to be applied in putting together a simple batch file that can remove all connecting flights from a standard airlines flight schedule? I have downloaded several airline(PDF)timetables from their perspective websites and have cut and pasted their contents into a .txt file. Now I wish to create a batch file that will remove all the connecting flights from that .txt file and then have a new .txt file created that will show the non-stop flights only. This new file will be used to help simplify creating ACTUAL airline flights for use with Flight Simulator 2004.

Thanks in advance.A batch file could never do what your asking. Actually a script or a program would not be able to either. The schedule you find on a web site is not the whole story.

The airlines use a relational database in which all connecting flights are logically connected to the whole flight as a unit. Building the database they define a high-order key, low-order keys and then the data portion of the record. What you see on a web page is only the data portion of the airline database. Without the key info there is just a set of disparate records with no common thread.

Hope this helps.


It can done with a .txt file IF every non-stop flight has at least one phrase in common. For example, if they all have "non-stop" in the line of text. Then the find command can be used to locate the lines that say non-stop and be redirected to a different .txt file.Thanks for the replies. Most airline timetables that you download(pdf)are fairly similar in form/layout, with a few exceptions. Many airlines also offer electronic timetables that have, I assume, list type files that are used as PART of the program for plotting flight schedules when the user picks particular parameters(dates/departure/arrival airports, etc.). I suppose either one might be used for the required information. I just use the simple method of cut and paste from the pdf to a txt file. Then using available tools(usually "replace/replace with") I search for common variables in those files(line by line) such as "/" or any numbers between certain variables that lead to any "connecting flights" that might be listed.

example from Spirit Airlines pdf timetable

ATLANTIC CITY (ACY)
Destination Flight DEPARTS Arrives Stops Freq.
CANCUN 259/271 7:15a 1:05p 1/FLL D>>>STOPDELETE<<<
DETROIT 330 5:00p 6:45p - D>>>NON-STOP KEEP<<<
FT. LAUDERDALE 259 7:15a 9:50a - D>>>NON-STOP KEEP<<<
265 4:15p 6:50p - D>>>NON-STOP KEEP<<<
FT. MYERS 945 2:20p 5:05p - D>>>NON-STOP KEEP<<<
LAS VEGAS 330/711 5:00p 9:20p 1/DTW D>>>STOPDELETE<<<
LOS ANGELES 330/706 5:00p 9:40p 1/DTW D>>>STOPDELETE<<<


I then proceed to manually delete each line(bold above) of flights that contain connecting flights to end up with all "non-stop flights only" on my txt file. I should mention that when copying/cutting from the pdf file I use the "column select tool" from the menu which allow me to copy individual columns rather than a full page which might lead to corrupted data(due to mismatch between columns/ pages)

On smaller carriers it's not that big of a project to sort out the non-stop flights, for the bigger carriers you might spend hours(if not days)going through the entire schedule sorting out all the non-stops from connecting flights(and that's just the first STEP in creating flight plans for FS2004)

2k wrote:It can done with a .txt file IF every non-stop flight has at least one phrase in common.

I have seen this used in sample files but am unfamiliar with writing batch files(or scripts)myself. If you go to most major airline websites they have available their current schedule available for download ....example:

http://www.atatimetable.com/ATA.pdf

if you try a few others i'm sure you will see that they are fairly similar in their layout.

Just thought i'd see if there might be a shortcut of some KIND to help the process.

Thanks again for your time.



Discussion

No Comment Found