Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

GREP Question

Participant ,
Dec 08, 2017 Dec 08, 2017

Hello all, I'm attempting to style a large amount of titles (formatted in the style shown below)Screen Shot 2017-12-08 at 11.42.27.png

I need to change them into the following styles.

Screen Shot 2017-12-08 at 11.43.21.png

Screen Shot 2017-12-08 at 11.47.37.png

So it should end up looking like this


Screen Shot 2017-12-08 at 11.50.55.png

It's always in the same style, (number | title | country | date | creator) and I was curious if there was a way I could do this using GREP, I'm pretty sure it's possible, I just can't work out the right sequence. I suppose I would need to be able to specify which | I was referring to. Any ideas?

Thanks

1.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Mentor , Dec 08, 2017 Dec 08, 2017

IMO, nested styles is enough:

Nested.PNG

Translate
Mentor ,
Dec 08, 2017 Dec 08, 2017

IMO, nested styles is enough:

Nested.PNG

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 08, 2017 Dec 08, 2017

Hi,

More complicated if the "  |  " uses the same font weight (para style default!)!

Capture d’écran 2017-12-08 à 13.43.37.png

(^/)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 08, 2017 Dec 08, 2017
LATEST

Capture d’écran 2017-12-08 à 14.11.54.png

(^/)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 08, 2017 Dec 08, 2017

Do you know how to work with nested styles?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 08, 2017 Dec 08, 2017

I do! I didn't realise you could specify characters though, I thought you could only use words/letters etc.

Thank you both!

I've realised a slight obstacle may occur at some instances in the book where no date or location is known. What would be the best way to circumnavigate this? A separate paragraph style for each instance e.g. one for missing date, one for missing location?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Dec 08, 2017 Dec 08, 2017

Dative  wrote

A separate paragraph style for each instance e.g. one for missing date, one for missing location?

The most obvious solution, I guess.

For entries with no date you can search using regex "find occurrences that do NOT contain 4 digits in a row". Something like this: ^.(?!.+\d{4})

Not sure if it's possible to automate find of missing locations.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines