I believe this my first post here, so yay!?!!
For context, I am formatting a reference book listing available services by city/state. With this, I must develop an Index of those services in a particular structure. Having looked around, I see references to GREP scripts but TBH, that’s a bit beyond me. I really don’t even know if GREP is the way to go, so I am posting here for opinions and/or redirection.
The book format is something like this:
————–
State01
City01
Topic01: Item01; Item02; Item03
Topic02: Item01; Item05
Topic03: Item01; Item02; Item09
City02
Topic01: Item01; Item02
Topic02: Item01; Item02
Topic04: Item01; Item04
State02
City01
Topic01: Item01; Item02; Item06
Topic02: Item01; Item02
City02
Topic05: Item01; Item05
————–
Format and punctuation are consistent, so it may be possible to make use of the : and ; but I haven’t a clue where to begin there. The output Index must retain the following structure:
————–
Topic01
State01 (if it has any elements listed for Topic01)
Item01…..page x, y (where x is the listing of the first city, and y is the listing of the second city using the same topic)
Item02…..page x, y
Item03…..page x
State02 (if it has any elements listed for Topic01)
Item01…..page x
Item02…..page x
Item06…..page x
Topic02
…etc.
————–
I’ve tried to simplify the hierarchy as best as I can, while providing simple examples of how the items are being listed and called. I’ve done this manually in the past and can do so again if need be but I’m hoping there is an automation that I can use. Too, I would love to learn something new here!
Thanks in advance for your time and suggestions,
– Noel.