Copy link to clipboard
Copied
At the present, I have a TOC that looks like this:
But I want all of the content on one line like this (meaning, each title and content has its own row)
How do I acheieve this? I have created Paragraph Styles to pull the information through.
Thank you in advance for your help.
[Even without seeing the invisible chars and after having generated the TOC], it could just be a simplistic set of 3 regex! … No more.
Find: ^\t(\t\d{4}\t\d+\r)(\t.+?)$\r? Replace by: $2$1
Find: ^[^\t]+\K\r Replace by: nothing
Find: \r\z Replace by: nothing
(^/) The Jedi
Copy link to clipboard
Copied
So you're saying that the year is a separate paragraph in the document, and the song title a different paragraph, and therefore when you pull them into the TOC they appear as 2 separate paragraphs?
That's just the way it works. You'll have to generate the TOC, and then manually remove and reformat the way it looks.
Of course, the bad news is that if you ever need to update the TOC, you'll lose that manual formatting and have to redo it.
If that's a problem, check out my (not free) script: https://www.id-extras.com/products/livetoc/
It will turn the page numbers into live cross-references, so they update completely automatically if anything move around in the document. So you would (1) generate the TOC, (2) run LiveTOC, (3) format the TOC manually however you like, and at this point the page numbers update automatically so you'd never need to manually format it again.
Copy link to clipboard
Copied
Thank you TAW. I will try the manual suggestion in the above, but if all else fails, I will buy your script and give it a go. Thank you for your help with this issue.
Copy link to clipboard
Copied
[Even without seeing the invisible chars and after having generated the TOC], it could just be a simplistic set of 3 regex! … No more.
Find: ^\t(\t\d{4}\t\d+\r)(\t.+?)$\r? Replace by: $2$1
Find: ^[^\t]+\K\r Replace by: nothing
Find: \r\z Replace by: nothing
(^/) The Jedi
Copy link to clipboard
Copied
Such a rookie here! Sorry Mike, I am still stuck on this issue. Where will I find the 3 Regex you have mentioned? I have looked in my TOC Style, and in the individual paragraph styles for the characters you have typed, but can only see (tab) ^t regex on the Year Style. Here is a screen shot with hidden char values turned on.
Copy link to clipboard
Copied
Apologies for the delayed reply. Thank you so much for your information, I will give it a try.