1 person found this helpful
The first is pretty easy using GREP.
Search for \*\*(.+?)\*\* where ** stands for the marker on eiter side of the italics. Since * (and $) is a special character in GREP you need to "escape" it in the query code. $ is not a good choice for the marker, though as it fails in my testing, though I don't know why.
Replace with $1
You can add formatting by using the Change Options. Click the magnifier next to the box at the bottom of the dialog to open them. Either pick an italic character style (recommended) or set the font properties directly. YOu can do that for both your random words or phrases and your separator (not clear to me if you are trying to repace that with an actual paragraph break, which you can also do). For the separator you can stay inthe GREP tab or switch to plain text since you are looking for a specific character regardless of location or what else might be around it.
for the italic solution, i'd say the OP answered his own question with one exception - don't use dollar symbols, instead use = or another character which isn't reserved by GREP.
the solution i would use for italics would be a GREP search once the merge is complete. have a look at the picture to see what i've done.
the second solution: GREP styles.
this assumes that the text will have a paragraph style assigned to it. make a character style called BOLD and within that style, the only thing to change is within basic character formats, make the font style bold. could even make the character another colour such as cyan so it is more easily idenfiable.
next, go to the paragraph style options, go to GREP styles and match the following screengrab
the advantage with a GREP style is that once the pipe symbol (|) is replaced, its bold GREP style character formatting is lost; and it means less post processing and no need for a second search of the text - it's all live.
Thanks for the responses guys, I'm relieved there certainly seems a way to do these.
Will have a go at these solutions once back home and report back with my results (once I familiarised myself with GREP - Im a newbie).
Again, thanks very much.
Thanks very much, worked a treat.
Convert to Italics:
As suggested, I applied a GREP find/replace of words contained between the '%i%' identifiers to have the Italics applied. Worked a treat except that the '%i% remained, however this can obviously be removed using a simple find/replace. So all good there
Convert to Bold:
With regard to the two options suggested, I decided to keep the apply format changes within the find/replace domain so added the '+BOLD' there.
Isn't InDesign wonderful
Not sure how to allocate the correct/helpful answers, wish I could apply 'Correct' on both.
Thanks again fellas
On your "convert to italics" string, you could save yourself a second search by marking both "%i%" sections as subexpressions:
and change your Replace statement to "$2". You want to find everything that's bounded by "%i%", but you only want to return what's in the second set of parentheses.
Hi Mary, you're right. 'Cdflash' above had already suggested it but for some reason my '$2' didn't work so trialled and errored until the $0 worked.
But just had a another go and indeed it works.
That's what I get for not reading the whole thread thoroughly! You're right, cdflash did suggest exactly that search. I wonder why it didn't work the first time.
Im not sure why neither, but I'd guess it had something to with the following ;
- I typed in '$2' manually, before realising it was a dropdown choice.
- Also, the 'Found Text 2' dropdown only showed after doing a 'Find All'. Only the 'Found Text' had previously been available.
There isn't anything wrong with typing "$2" in the Replace field. That should have worked, as long as you had a second subexpression in your Find field.
Maybe things are different on the Windows side (I'm on a Mac), but Found Text ($0) and Found 1-9 show up for me whether a search has been run or not, so I don't know what's going on there.
Anyway, glad you got something that worked to solve your problem!