Basic Find/Change question
Learn / Forums / General InDesign Topics / Basic Find/Change question
Tagged: FIND CHANGE/GREP
- This topic has 6 replies, 3 voices, and was last updated 9 years ago by Aaron Troia.
-
AuthorPosts
-
-
March 2, 2015 at 2:44 pm #73654whiskeytangofoxtrotMember
I’ve imported a directory file created by an idiot. The firm name, address, phone, email, contact, etc., were EACH entered as a record in the Excel file I was provided. When placing in InDesign, I end up with a huge list of lines with no distinguishing “handle” to grab for formatting (bold, space before, font, etc.).
In an attempt to start somewhere, I’ve ended all lines with a soft return. I’m now attempting a find/change, the FIND being “soft return, any digit” (\n\d). How do I “let go” of the “any digit” to simply CHANGE to hard return (\r)? Thank you for any help here! -
March 2, 2015 at 3:06 pm #73656Colleen ShannonMember
Find ^n
Replace with ^p(I think that’s what you want?)
-
March 2, 2015 at 5:37 pm #73657Aaron TroiaParticipant
Just a note on Colleen’s Find/Change query, that will only work in a Text search, in a GREP search you would Find:
\n
and Replace with\r
. It does exactly the same thing, just in GREP. -
March 2, 2015 at 7:21 pm #73658Colleen ShannonMember
Thanks, A.A. I am not yet schooled in the ways of GREP.
-
March 2, 2015 at 8:14 pm #73659whiskeytangofoxtrotMember
Thank you Colleen and AA. Problem is, ALL of the lines, regardless of desired format, now end with \n. I’m trying to key off of a particular string (i.e., phone area code in parens). I can get the string through FIND but I then want to “let go” of part of what I found for the CHANGE.
-
March 3, 2015 at 10:27 am #73671Aaron TroiaParticipant
So it sounds like there is a lot of soft returns and you are wanting to clean them up as well as convert soft hyphens to hard hyphens? That’s kinda what it sounds like you’re saying with wanting to ” ‘let go’ of part of what you found for the CHANGE”
This will find all the soft returns (\n+) followed by any word character (\w), non-word character (\W), or digit (\d), while using a positive lookbehind (?<=), and replace the soft returns with a single hard return.
Find:
\n+(?<=\W|\w|\d)
Change:\r
Is that more along the lines of what you’re looking for?
-
March 3, 2015 at 3:07 pm #73684Aaron TroiaParticipant
Oops, I used a lookbehind (?<=) in my previous post when I should have used a lookahead (?=)
Find:
\n+(?=\W|\w|\d)
Change:\r
-
-
AuthorPosts
- You must be logged in to reply to this topic.