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

Use GREP to create a new line and header style after the last occurance of a words only once

Community Beginner ,
Nov 04, 2023 Nov 04, 2023

Copy link to clipboard

Copied

Hi 

I wonder if someone can help I have a list of skills. And because of the short comings of the data collection method I had to put them into one column in a datamerge. 

I'm trying to use GREP to find just the last occurance of a skill (only once) "Stunt Coordinator" or "Second Unit Director" or "Stunt Performer" or "Doubled For" to then add a return and give it a header title skill. Like in the photo attached. In the photo I'm testing it on just one word but I'm not having any luck. Can someone help please.

Thank you

Screenshot 2023-11-04 at 08.26.16.png

TOPICS
Scripting

Views

522

Translate

Translate

Report

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 ,
Nov 04, 2023 Nov 04, 2023

Copy link to clipboard

Copied

Hi @British Stunt Register, can you show a screenshot of what it should look like afterwards?

- Mark

Votes

Translate

Translate

Report

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 Beginner ,
Nov 04, 2023 Nov 04, 2023

Copy link to clipboard

Copied

It would search for Stunt Double then create a header and have the name of the show and then the actor name

 

Screenshot 2023-11-04 at 09.02.28.png

Votes

Translate

Translate

Report

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 ,
Nov 04, 2023 Nov 04, 2023

Copy link to clipboard

Copied

Hi @British Stunt Register, sorry that's not quite what I was asking for. It would be easiest for anyone reading here if you can show a simple before and after situation. So we can see a representative example of what you are starting with, and then what you expect to have after the help you are asking for.

 

From your screenshot I can guess something like the following:

 

1. You search for certain words in a given story or document, eg, the grep

Role: (Stunt Double|Second Unit Director|Some Other Role)

 

 2. You pick the last one in the story and add a new paragraph after its paragraph and apply the green sub-heading/rule below paragraph style.

 

3. The text of the new paragraph style is dependent on the text found in the grep, but not the same, eg "Stunt Double" —> "Doubled For".

 

Is that close? It helps to be as explicit as possible, because the easier you make it for someone to understand, the more chance of someone being able to help you.

- Mark

Votes

Translate

Translate

Report

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 Beginner ,
Nov 04, 2023 Nov 04, 2023

Copy link to clipboard

Copied

Hi Mark,  sorry about that you're absolutely correct. The Before for a performer is below and they tend to have more stunt double roles then coordinators who run the shows as either a Stunt Coordinator, Second Unit Director or Stunt Coordinator & Second Unit Director. But they can also be a stunt double or stunt car driver (which should go under doubled for), actor, character.

"Production: Black Widow, Role: Stunt Double, Doubled For/Character Name: David Harbour
Production: The Last Duel, Role: Stunt Double, Doubled For/Character Name: Adam Driver
Production: Star Wars: EpIX, Role: Stunt Double, Doubled For/Character Name: Adam Driver
Production: Star Wars: EpVIII, Role: Stunt Double, Doubled For/Character Name: Adam Driver
Production: Han Solo, Role: Stunt Performer, Doubled For/Character Name:
Production: Rogue One, Role: Stunt Performer, Doubled For/Character Name:
Production: Fast X, Role: Core Team, Doubled For/Character Name:
Production: Argylle, Role: Core Team, Doubled For/Character Name:
Production: Jack Ryan, Role: Stunt Double, Doubled For/Character Name: John Kraskinski
Production: Hitman's Wife's Bodyguard, Role: Stunt Double, Doubled For/Character Name: Tom Hopper
Production: Penny Dreadful, Role: Stunt Double, Doubled For/Character Name: Josh Hartnett
Production: Hobbs & Shaw, Role: Actor, Doubled For/Character Name: Lermotov
Production: The Witcher, Role: Actor, Doubled For/Character Name: Prison Guard
Production: Her Pen Pal, Role: Actor, Doubled For/Character Name: Seth
Production: School For Good & Evil, Role: Character, Doubled For/Character Name: Cyclops
Production: Game Of Thrones: S8, Role: Stunt Performer, Doubled For/Character Name:
Production: The King's Man, Role: Stunt Performer, Doubled For/Character Name:
Production: Kingsman: Golden Circle, Role: Stunt Performer, Doubled For/Character Name:
Production: Jurassic World 2, Role: Stunt Performer, Doubled For/Character Name:
Production: Angel Has Fallen, Role: Stunt Performer, Doubled For/Character Name:"

 

And this for a Coordinator, Head of Department, like the screenshot I gave you with the red text but that is after I did a find and replace on the data removing things. The original data looks like this: Annonyingly the form I used to grab the data kept "Doubled For/Character Name:" label even if that field was left empty.

"Production Name: Murder is Easy , Role: Stunt Coordinator, Doubled For/Character Name:
Production Name: Buccaneers , Role: Stunt Coordinator, Doubled For/Character Name:
Production Name: The control Room, Role: Stunt Coordinator, Doubled For/Character Name:
Production Name: Crime, Role: Stunt Coordinator, Doubled For/Character Name:
Production Name: Alex Rider 2, Role: Additional Stunt Coordinator, Doubled For/Character Name:
Production Name: Batman - Vengeance , Role: Vehicle Stunt Coordinator, Doubled For/Character Name:
Production Name: Kraven , Role: Vehicle Stunt Coordinator, Doubled For/Character Name:
Production Name: Call the Midwife season 13, Role: Stunt Coordinator, Doubled For/Character Name:
Production Name: Phoenix Rise , Role: Stunt Coordinator, Doubled For/Character Name:
Production Name: Gangs of London 2 , Role: Additional Stunt Coordinator, Doubled For/Character Name:
Production Name: DI Ray, Role: Additional Stunt Coordinator, Doubled For/Character Name:
Production Name: Pandemonium , Role: Stunt Coordinator, Doubled For/Character Name:
Production Name: Whitstable Pearl, Role: Additional Stunt Coordinator, Doubled For/Character Name:
Production Name: Bad Sister , Role: Additional Stunt Coordinator, Doubled For/Character Name:
Production Name: The lost King, Role: Stunt Coordinator, Doubled For/Character Name:
Production Name: Batman - Vengeance, Role: Stunt Car Driver, Doubled For/Character Name: Colin Farrell
Production Name: McDonald & Dodd, Role: Stunt Coordinator, Doubled For/Character Name:
Production Name: Blue Light season 2, Role: Additional Stunt Coordinator, Doubled For/Character Name:
Production Name: Firehouse - Ghostbusters, Role: Stunt Double, Doubled For/Character Name: Dan Akroyd
Production Name: Matilda , Role: Stunt Car Driver, Doubled For/Character Name: Aljaz Škorjanec
Production Name: Insomnia, Role: Stunt Car Driver, Doubled For/Character Name: Neil Sheffield
Production Name: Town Called Malice , Role: Stunt Performer, Doubled For/Character Name:
Production Name: Star Wars 9 - Rise of Skywalker , Role: Stunt Car Driver, Doubled For/Character Name:
Production Name: Fast n Furious 9, Role: Stunt Car Driver, Doubled For/Character Name: Helen Mirren
Production Name: Kingsman 3, Role: Stunt Car Driver, Doubled For/Character Name: Archduke Ferdinand Driver
Production Name: Cruella, Role: Stunt Car Driver, Doubled For/Character Name:"

For a Performer I'd like and for lack of a screenshot I'm just using text but the style for the headers is the same as the first screenshot:

Credits Include
------------------------------------------------------------------------------------------------------------------------
Rogue One, Stunt Performer
Fast X, Core Team

Game Of Thrones: S8, Stunt Performer
The King's Man, Stunt Performer
Kingsman: Golden Circle, Stunt Performer
Jurassic World 2, Stunt Performer
Angel Has Fallen, Stunt Performer

Doubled For
------------------------------------------------------------------------------------------------------------------------
Black Widow, Stunt Double: David Harbour
The Last Duel, Stunt Double, Adam Driver


Actor & Character Work
------------------------------------------------------------------------------------------------------------------------

Hobbs & Shaw, Actor: Lermotov

School For Good & Evil, Character: Cyclops

Production: The Witcher, Actor: Prison Guard
Production: Her Pen Pal, Actor: Seth


For Coordinator:

Credits Include

------------------------------------------------------------------------------------------------------------------------
Murder is Easy, Stunt Coordinator, 
Buccaneers, Stunt Coordinator, 
The control Room, Stunt Coordinator, 
Crime, Role: Stunt Coordinator, 
Alex Rider 2, Additional Stunt Coordinator, 
Batman - Vengeance, Vehicle Stunt Coordinator, 
Kraven, Vehicle Stunt Coordinator, 
Call the Midwife season 13, Stunt Coordinator, 
Phoenix Rise, Stunt Coordinator, 
Gangs of London 2, Additional Stunt Coordinator, 
DI Ray, Additional Stunt Coordinator, 
Pandemonium, Role: Stunt Coordinator, Doubled For/Character Name:
Production Name: Whitstable Pearl, Role: Additional Stunt Coordinator, Doubled For/Character Name:
Production Name: Bad Sister , Role: Additional Stunt Coordinator, Doubled For/Character Name:
Production Name: The lost King, Role: Stunt Coordinator, Doubled For/Character Name:
Production Name: Batman - Vengeance, Role: Stunt Car Driver, Doubled For/Character Name: Colin Farrell
Production Name: McDonald & Dodd, Role: Stunt Coordinator, Doubled For/Character Name:
Production Name: Blue Light season 2, Role: Additional Stunt Coordinator, Doubled For/Character Name:

 

Doubled For
------------------------------------------------------------------------------------------------------------------------
Matilda , Role: Stunt Car Driver: Aljaz Škorjanec
Insomnia, Role: Stunt Car Driver: Neil Sheffield
Fast n Furious 9, Stunt Car Driver: Helen Mirren
Kingsman 3, Stunt Car Driver: Archduke Ferdinand Driver
Firehouse - Ghostbusters, Stunt Double: Dan Akroyd

 

 

So if they don't have anything after the :Doubled For/Character Name:" then they should go in Credits include.


I've also noticed some people leaving a space after words so it becomes Matilda , instead of Matilda. I hope that makes sense.

Votes

Translate

Translate

Report

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 ,
Nov 04, 2023 Nov 04, 2023

Copy link to clipboard

Copied

GREP styles won't add or remove characters - they will only apply formatting to selections.

I agree that GREP searches would be appropriate. But you would need more than one.

I'd suggest a few GREP tools that will help:

first is this script that allows you to chain many GREP searches: https://creativepro.com/chaingrep-grep-script/

then there is this script from Peter Kahrel that expands GREP capabilities, such as highlighting matches throughout the document to see if the GREP is finding too little or too much: https://creativepro.com/files/kahrel/indesign/grep_editor.html

If the answer wasn't in my post, perhaps it might be on my blog at colecandoo!

Votes

Translate

Translate

Report

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 Beginner ,
Nov 04, 2023 Nov 04, 2023

Copy link to clipboard

Copied

Yeah I saw that which is why I did a find and replace

Votes

Translate

Translate

Report

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 ,
Nov 04, 2023 Nov 04, 2023

Copy link to clipboard

Copied

If you work on a PC - is it one-time job or do you have to do it more often? 

 

Votes

Translate

Translate

Report

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 Beginner ,
Nov 05, 2023 Nov 05, 2023

Copy link to clipboard

Copied

I'm on a Mac and it is a one time job. Although I will have to do it again once these proofs are checked.

Votes

Translate

Translate

Report

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 ,
Nov 05, 2023 Nov 05, 2023

Copy link to clipboard

Copied

@British Stunt Register 

 

James -- It's still not very clear what the before and after states are. You said 'The Before for a performer' -- where is that performer? What to do with them? And 'For a Performer I'd like and for lack of a screenshot I'm just using text . . .' isn't very clear either.

 

As Mark requested earlier, please provide literal examples of the before and after states.

 

Though I don't understand what exactly you're after, it looks not simply like (re-)formatting, which can be handled by search-and-replace, but a proper transformation, for which you'll need a script.

 

P.

Votes

Translate

Translate

Report

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 Beginner ,
Nov 05, 2023 Nov 05, 2023

Copy link to clipboard

Copied

Thank you sorry about that, here is what Im' looking to achieve: 

Like what @m1b stated I'm trying to search for roles:

1. Search for certain words in a given story or document, eg, the grep

Role: (Stunt Double|Second Unit Director|Second Unit Director & Stunt Coordinator|Actor|Character)

 2. Pick the last one in the story and add a new paragraph after its paragraph and apply the green sub-heading/rule below paragraph style.

3. The text of the new paragraph style is dependent on the text found in the grep, but not the same, eg "Stunt Double" —> "Doubled For".

Screenshot 2023-11-05 at 13.11.18.png

 

Here is the raw data:
I can search and replace the "Production Name:" and the "Doubled For/Character Name:" like previous comments suggested, thank you.

Production Name: The Crown S6, Role: Additional Stunt Coordinator, Doubled For/Character Name:
Production Name: The Larkins S2, Role: Additional Stunt Coordinator, Doubled For/Character Name:
Production Name: Kidnapped, Role: Additional Stunt Coordinator, Doubled For/Character Name:
Production Name: Meg2: The Trench, Role: Stunt Performer, Doubled For/Character Name:
Production Name: Andor S2, Role: Stunt Performer, Doubled For/Character Name:
Production Name: Heads of State, Role: Stunt Performer, Doubled For/Character Name:
Production Name: Wicked, Role: Stunt Performer, Doubled For/Character Name:
Production Name: Blitz, Role: Stunt Performer, Doubled For/Character Name:
Production Name: Red Eye, Role: Stunt Double, Doubled For/Character Name: Lesley Sharp
Production Name: Murder They Hope, Role: Stunt Double, Doubled For/Character Name: Annette Badland
Production Name: Apartment 7A, Role: Stunt Double, Doubled For/Character Name: Tina Gray
Production Name: Dinner with the Parents, Role: Stunt Double, Doubled For/Character Name: Carol Kane
Production Name: Doc Martin, Role: Stunt Double, Doubled For/Character Name: Beth Goddard
Production Name: Challenge, Role: Character, Doubled For/Character Name: Stunt Neighbour
Production Name: A Thousand Blows, Role: Character, Doubled For/Character Name: Head Cook
Production Name: Boat Story, Role: Stunt Double, Doubled For/Character Name: Joanna Scanlan
Production Name: Titanic, Role: Character, Doubled For/Character Name: Drowned Woman Floating
Production Name: Braveheart, Role: Stunt Performer, Doubled For/Character Name:
Production Name: My House in Umbria, Role: Stunt Double, Doubled For/Character Name: Maggie Smith
Production Name: Shaun of the Dead, Role: Character, Doubled For/Character Name: Fainting woman
Production Name: Eastern Promises, Role: Stunt Double, Doubled For/Character Name: Naomi Watts
Production Name: Hyde Park on Hudson, Role: Stunt Double, Doubled For/Character Name: Laura Linney
Production Name: 44 Inch Chest, Role: Stunt Double, Doubled For/Character Name: Joanne Whalley
Production Name: Harry Potter 4 - 8, Role: Stunt Double, Doubled For/Character Name: Helena Bonham Carter
Production Name: Red 2, Role: Stunt Double, Doubled For/Character Name: Helen Mirren
Production Name: White Girl, Role: Stunt Coordinator, Doubled For/Character Name:
Production Name: Skyfall, Role: Stunt Performer, Doubled For/Character Name:
Production Name: Fast & Furious 6, Role: Stunt Double, Doubled For/Character Name: Michelle Rodriguez
Production Name: Mary Poppins Returns, Role: Stunt Double, Doubled For/Character Name: Julie Walters
Production Name: Rocketman, Role: Character, Doubled For/Character Name: Old Pub Woman

Thank you

Votes

Translate

Translate

Report

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 ,
Nov 05, 2023 Nov 05, 2023

Copy link to clipboard

Copied

@British Stunt Register 

 

So you want to get your screenshot from the raw text at the end of your message? 

 

GREP will never to that - as you need to rebuild the whole text = custom script. 

 

... 

 

If you've access to Excel or something similar - you could do this semi-automatically - convert ","  and ":" to tabs, copy to Excel, sort by 4th column...

But still more processing needed = custom script. 

 

Votes

Translate

Translate

Report

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 Beginner ,
Nov 05, 2023 Nov 05, 2023

Copy link to clipboard

Copied

Yes, that's right.

 

Ultimately I just need to search for certain roles and put stuint double in it's own category and actor & character in another category. 

Votes

Translate

Translate

Report

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 ,
Nov 05, 2023 Nov 05, 2023

Copy link to clipboard

Copied

LATEST

Then maybe @FRIdNGE could think of a few magic steps using GREP - otherwise only custom script or playing in Excel - because what you are looking for is a complete re-arrangement of the contents - not just change to a local formatting.

 

Votes

Translate

Translate

Report

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