Question: You are given a text file that contains the timetable for buses that travel a college campus. The first line of the file contains the

You are given a text file that contains the timetable for buses that travel a college campus. The first line of the file contains the name for each stop on the bus system separated by colons. Each following line contains the times using a 24-hour clock at which each bus in the system will arrive at a bus stop, also separated by colons. A sample file is attached to this problem.

Write a program in Perl that reads this file and outputs a row for each bus stop, showing the times when a bus arrives at that stop.

Sample data file:

Edinburgh:Danderhall:Dalkeith:Edgehead:Pathhead:Blackshiels:Oxton:Carfraemill:Lauder:Earlston:Leaderfoot:Newtown St Boswells:St Boswells:Clintmains:Kelso

0850:0911:0918:0930:0933:0939:0953:0955:1001:1015:1025:1029:1032:1038:1055

1150:1211:1218:1230:1233:1239:1253:1255:1301:1315:1325:1329:1332:1338:1355

1350:1411:1418:1430:1433:1439:1453:1455:1501:1515:1525:1529:1532:1538:1555

1610:1633:1640:1652:1655:1701:1715:1717:1723:1737:1746:1750:1753:1803:1820

1750:1811:1818:1830:1833:1839:1853:1855:1901:1919:1925:1929:1932:1938:1955

2000:2021:2028:2037:2040:2046:2100:2102:2108:2121:2126:2130:2133:2138:2155

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!