I'm thinking that the colon might not be a good delimiter based on a need to provide a time example. I've attached what the input file would look like. I'm thinking of changing the ':' to a '-' to try to make use of strchr().
Code:
Agency Name: Test
Agency POC: Mr. Test
POC Phone: 12345
POC Email: [email protected]
Aircraft Type: B747
Aircraft Tail: 0000
Aircraft Callsign: HVY123
Arrival Date(**dd/mm/yyyy): 01/01/2021
Arrival Time(**HH:MM Zulu): 15:45
Previous ICAO: KMCO
Departure Date(**dd/mm/yyyy): 01/01/2021
Departure Time(**HH:MM Zulu): 19:00
Next ICAO: KADW
Inbound Passengers(Number): 247
Inbound DV(Number): 0
Inbound Cargo(Details): None
Inbound HAZMAT(Details): None
Outbound Passengers(Number): 240
Outbound DV(Number): 17
Outbound Cargo(Details): None
Outbound HAZMAT(Details): None
In my program code, I'm reading in each line using fgets and then a function to remove the trailing new line character.
Code:
fgets(new->AgencyInfo.AgencyName, 100, inFile);
removeNL(new->AgencyInfo.AgencyName);
Could I use the strchr function on the struct element?