I'm trying to read in a specific text file that will contain either codes 1, 2, 3, or 4. My program is supposed to keep track of flights and reservations. If the code is 1, it will add a new reservation, so the 1 is followed up by all the information needed for a reservation. If the code is 2, it will give me a reservation number, and I am supposed to print the itinerary for that reservation. If it is 3, I print all itineraries, and if it is 4, I write all of the reservations to a new file. I'm not sure how to go about this, and I'm really stuck! Please help!
Here is what the text file contains:
1
John Miller
1234
UA1235
06/12/2014
ORD
LGA
4:00 PM
7:15 PM
30F
UA673
06/19/2014
LGA
ORD
10:00 AM
11:25 AM
10E
3
1
Bob Barker
8497
UA317
08/04/2014
ORD
SFO
8:10 AM
10:45 AM
12A
UA728
08/14/2014
SFO
ORD
12:52 PM
7:03 PM
18A
2
1235
2
8976
3
4
I do not necessarily need specifics which is why I'm not providing any code. I was just wondering how I can go about doing this. Let me know if you need more to answer the question.