Copy link to clipboard
Copied
I am creating an index at the back of the brochure based upon Product Numbers. There are two product numbers per product. In the image below it is one product per line.
Ideally I need the first product number, then a tab, then the next product number, then a page number -- All on the one line.
This is my data ->
This is the desired way I'd like it displayed -->
I required the two product codes to stay grouped together, as it would be good if the entire index was in alphabetical order.
My first product codes have one paragraph style assigned, the second have another assigned.
Any help greatly appreciated!
Copy link to clipboard
Copied
I assume the original data in a table, hence the two paragraph styles.
You could collect the two product numbers and just the page number on the second one with a TOC Style.
ORFT3S-XXX
004519-XX <tab> PageNum
Clean up with a Find/Change.
Copy link to clipboard
Copied
Hi @LSY86:
I agree with Dave's approach. I would set this up as a TOC and not an index—it will take less time and effort.
Taking it a bit further, call both paragraph styles into the TOC—and check the Sort Entries in Alphabetical Order checkbox.
That will produce the list similar to this (but I typed it in your order and not alphabetical). Set the two necessary tab stops.
GREP is not my strength, but this works, according to what you have shared with us.
Change All.
Result.
Once working, save the query because you will need to run it after each TOC update.
~Barb
Copy link to clipboard
Copied
Thank you so much for your response. Unfortunately I see now the data isn't quite represenative of the entire table. The XXX or XX don't appear on data further down.
Copy link to clipboard
Copied
Hi @LSY86:
As I said in my post, "...this works, according to what you have shared with us." We can work with what you choose to share.
~Barb
Copy link to clipboard
Copied
Thanks Barb - Do you have any further suggestions? For example, here is another sample of the data. Thanks
Copy link to clipboard
Copied
Same principle but you need to put something distinctive at the end of the first paragraph style so you can distinguish it when doing the find/change. Search for with GREP so you can replace the actual paragraph style content and remove the special characters and any digits before the paragraph return.
You would search for "P60113@@4^p" and replace it with "P60113^t".
Let us know if you need the actual GREP F/C query.