Is there a way to align lines on a mark or character? Something like amsmath's alignment, where you can easily align multiline equations on the equal sign. Haven't found anything like it and scripting it sounds kinda messy.
intended result:
topic 1 * page 16
topic 78 * pages 18 -24
tabulators might get you the desired result. might be a bit fussy to do on a line by line basis, if there a lot of these needed.