Now you have two files with routes, one with the old routes for all travelers, and one with the new routes for 10% of the travelers. We need to merge them.13.1For the merging, we can assume that the plans are in order, since they are generated from the same trips file. So you have to write code which does the following:
Open both files, old.plans and new.plans.
Read the first plan from each file.
If they have the same traveler id, then
discard the old plan and write the new plan into merged.plans.
Read the next plan from each file, and continue.
If they do not have the same traveler id, then
write the old plan into merged.plans.
Read the next plan from old.plans, and continue.
Note that you could use ReadPlans and WritePlans from Secs 9.4 and 11.8. Awk does not work so well here since the format is not line oriented.