7 Replies Latest reply on Oct 5, 2011 5:49 AM by Mr. Met

    I want to search for all names and italicized them

    Mr. Met Level 3

      I have a directory. After each entry, there is a return, return, the students name, then a tab. I want to search for all double returns and then apply a character style up to the first tab. Is that possible? Screen shot attached. I circled the name. There are two returns before the name and a tab immediately after. Any help greatly appreciated. There are four grades and I don't fancy doing it all by hand. Thx.

       

      Style search.jpg

        • 1. Re: I want to search for all names and italicized them
          Mr. Met Level 3

          I was trying to GREP it but it's uncomprehensible.

          • 2. Re: I want to search for all names and italicized them
            Grant H Level 4

            create a character style called italicName the only attribute you change is font style to Italic.

            then (if you havent already) create a paragraph style based on your current text, select all the text and apply the paragraph style. Double click to edit the paragraph style in the paragraph styles panel, under drop caps and nested styles, click on new nested style, then click on "none" and select italicName, click on "through" and select up to, leave "1" then click on "words" select tab characters.

             

            • 3. Re: I want to search for all names and italicized them
              Mr. Met Level 3

              Thanks. That should work. One more question. I did the ninth grade. Fine. I import the 10th grade and it comes in as table. I convert to text and the address line goes to the end of each listing. OK. I open the MS Word file, select all, but covert table to text option is grayed out. How do I turn it into tabbed text?

              • 4. Re: I want to search for all names and italicized them
                Michael Gianino Level 4

                For what it's worth, those double returns could give you a problem if you're not careful. If an empty return falls at the beginning of a page or column, it will mess up the consistency of your layout to a degree. If you remove such an empty return when it crops up, you risk having two records without any space between if the flow of text changes the position of that record later. I'd also lose those two spaces before the parent's name and email addresses.

                 

                From the small sample you posted in your screenshot, each record could be done with a single paragraph, using space before to separate the records, and line breaks separating the student name/address/phone from the parent name and another for each email address. The nested style to set the names in italic can (and should) still be used, but you have to decide whether it's worth your time to go through and clean up the text or not. If it were me, I would set find to ^p and change to ^n, then alternate between Find Next and Change/Find, keeping my eye on the text as I went, but that's because I'm not a scripter, who could probably find a less time-consuming way to do it than I could.

                 

                I'd also set my paragraph style to a hanging indent to deal with the extra spaces at the beginning of the second and third lines. If you did it first, you could set find to ^p (with two spaces after) and change to ^n, which would only change the interior line breaks and not the doubles. That could be done much more quickly, potentially leaving you to just use the GREP for multiple returns to singles to deal with the space between paragraphs. A good look-see afterward is always a good idea, and I'd wait on saving until I was sure I wasn't screwing things up.

                 

                My 2¢.

                 

                Screen shot 2011-10-05 at 2.01.56 AM.png

                1 person found this helpful
                • 5. Re: I want to search for all names and italicized them
                  Mr. Met Level 3

                  Thanks for your help. Appreciate it. I do a lot of directories and oftentimes source files come from different sources. Each of the 4 HS class files came from 4 different parents and no two were formatted quite the same so a search and replace to expedite formatting is a major help.

                  • 6. Re: I want to search for all names and italicized them
                    [Jongware] Most Valuable Participant

                    This GREP expression will find exactly what you specified: anything from the start of a line up to the first tab, with at least two returns above it:

                     

                    (?<=\r\r).+?(?=\t)

                     

                    -- make sure the Change To field is blank and set the Change To Formatting to whatever you like.

                    • 7. Re: I want to search for all names and italicized them
                      Mr. Met Level 3

                      Thanks. I spent about a half hour trying to GREP this but it's pretty incomprehensible.