Search for Asterisk & text
Learn / Forums / General InDesign Topics / Search for Asterisk & text
- This topic has 7 replies, 3 voices, and was last updated 7 years, 1 month ago by Chelsea Schonhaut.
-
AuthorPosts
-
-
December 5, 2016 at 1:59 pm #90295Chelsea SchonhautMember
I have a client that sends me a word document with hundreds of names that are called out like so: *Firstname Lastname*
She does this so that we know to bold the name that is surrounded by asterisks.Is there a way to search for the asterisk with Find/Change in InDesign? Or, even better, is there a way to search the whole thing, and remove the asterisks after I’ve changed the name to bold?
Right now I can’t even figure out how to search for an asterisk, so any help would be much appreciated. Thanks.
-
December 5, 2016 at 2:32 pm #90299Chelsea SchonhautMember
Ok, I have figured out how to search for the phrase. Right now I am using \*[^*]+\*
But I still don’t know how I could automatically get rid of the asterisks after finding them and styling the text within them. Right now I am still doing that manually. Can anyone assist me with this?!
-
December 5, 2016 at 4:44 pm #90300Dwayne HarrisMember
I tried a simple experiment that seems to work.
The first thing I did was make a bold style sheet.
I then went to find and change and clicked on the grep tab. I searched for the string you put in. I then went to replace and selected my bold character style sheet. Replaced all.
I then deleted both the search and find fields in the grep area.
Then I clicked on regular search and replace “text” tab.” And searched for an asterisk and replaced with nothing.
Then replaced all.
NOTE: This was just searching and replacing, and not a grep thing to do automatically if new files are imported into the same file.
Just a basic search and replace of a few steps.
-
-
December 5, 2016 at 6:32 pm #90308David BlatnerKeymaster
This article might help: https://creativepro.com/findbetween-a-useful-grep-string.php
But in general, I would just search (in the grep tab) for
\*(.+?)\*
and then replace with$1
and set it to bold.-
December 6, 2016 at 4:05 pm #90338Dwayne HarrisMember
^^Does that delete the asterisks as OP wanted?
-
December 6, 2016 at 4:27 pm #90348David BlatnerKeymaster
Yes, it should. The code means “search for an asterisk followed by some text followed by an asterisk” and then $1 means “replace it with just the text”
-
December 7, 2016 at 5:50 am #90353Dwayne HarrisMember
Very impressive, David. I just tried a test and it worked perfectly!
-
February 24, 2017 at 3:08 pm #92400Chelsea SchonhautMember
This worked perfectly… thank you so much David! You are a life saver!
-
-
-
AuthorPosts
- You must be logged in to reply to this topic.