Copy link to clipboard
Copied
Hello all,
I'm trying to use GREP styles to accomplish a few things. I'd like to (1) style the Project Name, and (2) add a tab before Service ID and Start/End. Any idea of how to do that? I'm proid to say that I have figured out how to style the bolded characters.
If the project name always immediately precedes the Location tag, then you can use this GREP query:
Find what: ^.+\r(?=Location)
Change to: <Leave empty>
Change format: The paragraph style used for the project name
Copy link to clipboard
Copied
Hi April,
In your example, the Project Name in blue only needs to have a paragraph style applied. This assumes it is on a line with a hard return.
Adding a tab before a specific string of letters like SERVICE ID would only require a Find/Change in the Text tab.
Would you care to upload a sample of this text layout?
Copy link to clipboard
Copied
Hi @april_5679 , You should be able to do it with a Nested Style and an en space or a non breaking space as a marker. Something like this:
Copy link to clipboard
Copied
I don't think that this is a good case for nested styles, GREP or otherwise. In Rob's example, the use of nested styles depends on the presence of en spaces, which may not be the case. Furthermore, april mentions that they want to add a tab, and you can't add characters using a nested style.
The straightforward way to deal with this is a couple of Find/Change queries. Some apply bold to the labels (Location, consultant role, etc), and some apply bold and insert a tab (Service ID, etc.). Three or four queries would do it, and if files like these come up regularly those queries can be excecuted in one go by any of the several scripts that let you batch-run any number of Find/Change queries .
Copy link to clipboard
Copied
Hi all,
Please let me provide a little more information. Our content is being brought in by our database. Essentially, the database strips all formatting so we're trying to do some level of auto formatting when the database dumps the information into InDesign.
We are using the Find/Change Queries, as Peter noted, to add a Tab before Service ID, Start/End, and Construction Budget. I was hoping that maybe we could use GREP to auto apply a style to the Project Name. My first thought was to maybe add a character like | before the Project Name and then use GREP to apply the style to every instance of a 'sentence' that starts with |.
Copy link to clipboard
Copied
If the project name always immediately precedes the Location tag, then you can use this GREP query:
Find what: ^.+\r(?=Location)
Change to: <Leave empty>
Change format: The paragraph style used for the project name
Copy link to clipboard
Copied
Bingo!!! Thank you, Peter! This works perfectly. I have one more riddle for you. Is there a way to add a space before the project name? ( I could delete the space for the first instance but having a space would automatically separate the projects.)
Copy link to clipboard
Copied
Well, you apply a paragraph style to the project name, so you can add the space before in the paragraph style:
Copy link to clipboard
Copied
Hi Peter,
Excellent and simple response but I have a twist. Since we're using a database to bring the information into InDesign, it all comes in as one specific paragraph style. I had to use a Character Style for Project Name (which doesn't give the Space Before option. I tried adjusting the Leading but that doesn't work when the title spans two lines.
Is there a way to "add something" the GREP style you provided to add a space before the Project Name?
Here's what you provided before:
If the project name always immediately precedes the Location tag, then you can use this GREP query:
Find what: ^.+\r(?=Location)
Change to: <Leave empty>
Change format: The paragraph style used for the project name
Copy link to clipboard
Copied
In the Change format, you specify the paragraph style that's applied to the project name. That's the one in which you apply the space before.
Copy link to clipboard
Copied
Hi Peter,
Pure perfection! You've solved a problem we've been trying to solve for months. Oh goodness! Thank you!
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more