7 Replies Latest reply on Sep 20, 2011 1:04 AM by Haakenlid

    Formatting every 4th line

    jrd.vt

      I have a long directory of company names, addresses, etc. Each entry is 3 lines (paragraphs), followed by a blank line (paragraph). How may I quickly BOLD only the 1st line in each grouping? I can't see how to do it in Nested Styles (I can apply a style to the 1st line, but EVERY line is the 1st line since they are all separate grafs) or GREP styles. There has to be a better way than to manually select each 1st graf and bold it. I'm talking about hundreds of repetitions!

        • 1. Re: Formatting every 4th line
          Peter Spier Most Valuable Participant (Moderator)

          If each line is really a paragraph, then you want to edit the style applied to the first paragraph to make the font bold under basic character formats.

           

          Where each line is a spearate paragraph, and all listings contain the same number of lines, it's usually a simple matter to define a style for each line (base them on each other) and assign the next styles in sequence so line two style is next for line 1, 3 for 2, 4 for 3 and 1 for 4 so they rotate. You can then select all of the text in the thread and right click the name of the line 1 style and choose Apply  and next style and the formatiing will cascade through.

           

          If you are building the directory using Data Merge, apply teh styles to the lines containing the field placeholders in the template.

          • 2. Re: Formatting every 4th line
            BobLevine MVP & Adobe Community Professional

            Create a style for each paragraph and make sure to pay attention to the NEXT STYLE entry. Once you have that done, select all the text, right click the first style and choose apply style and next.

             

             

             

            Bob

            • 3. Re: Formatting every 4th line
              Daniel Flavin Level 4

              @Bob, what would you do with 500 records/paragraphs?

               

              It's fairly common for a directory to have inconsistant lines for each entry, which trips up the next style technique.

              In these instances, I really prefer forced line breaks.

               

              Assuming you have something like

               

              <<Name>>^p

              <<Address>> <<City>>^p

              <<Phone>>  <<Fax>>^p

              <<email>>^p

              ^p

               

              often you might not have an email line,

               

              Find/Change all Paragraph Breaks to Forced Line Returns  (^p to ^n)

              Find/Change all double Forced Line Returns to Paragraph Break (^n^n to ^p)

              Nest a Bold Character Style through one Forced Line Break

              • 4. Re: Formatting every 4th line
                jrd.vt Level 1

                This works pretty well, except... You know how you remove certain blank lines to prevent the top of a column from starting with an empty line? That foils the nesting method described, leaving some first lines unaffected. It doesn't help to run the process BEFORE removing blank lines, because the nested style will still remove the extra formatting from lines that have the blank line above them removed.

                • 5. Re: Formatting every 4th line
                  Peter Spier Most Valuable Participant (Moderator)

                  If the number of lines is inconsistent, the best method, in my opinion, is to use Data Merge to populate the document (presuming you have a way to get your listing into a .csv or tab-delimited file) and to apply the appropriate styles to the fields. Data Merge can remove blank lines, and it is always easier to bring the text in properly formatted than it is to chase it later, especially if you have situations where different lines might be removed from various listings.

                   

                  Directories are really not the simple lists they apprear, and some preparation is in order before creating the document.

                  • 6. Re: Formatting every 4th line
                    BobLevine MVP & Adobe Community Professional

                    There was no mention of inconsistency and the fact that it was every 4th line that was discussed I felt it was an appropriate answer.

                     

                     

                     

                    Bob

                    • 7. Re: Formatting every 4th line
                      Haakenlid Level 3

                      jrd.vt wrote:

                       

                      This works pretty well, except... You know how you remove certain blank lines to prevent the top of a column from starting with an empty line? That foils the nesting method described, leaving some first lines unaffected. It doesn't help to run the process BEFORE removing blank lines, because the nested style will still remove the extra formatting from lines that have the blank line above them removed.

                      Why do you need any blank lines at all?
                      Remove all blank lines and set spacing and keep options with paragraph styles.