Connecting different trip ids?

Hi in the Sydney Trains dataset, I find trip id “106E.1620.100.128.T.8.55256617” which goes from Hornsby to Central via Strathfield, but when it gets to Central it turns into trip id “106F.1603.102.128.T.8.54724776” and then continues down the Northern line back to Hornsby via Chatswood.

Whats the algorithm I can use to join these trips and display them as one long trip for my users ? I’ve noticed certain parts of the trip id are identical but I’m not sure that is it.

My app is for Mac. Download Transporter for Mac | MacUpdate

block_id is what you’re after. Check out the GTFS documentation and Sydney Trains GTFS technical documentation for more details.