4 Replies Latest reply on Aug 5, 2011 7:37 AM by Peter Spier

    How to bold the top line of text on a number of sections of text at once

    Sid2363

      Using CS5 (but we have CS5

      .5 available)  We are creating a business directory. Each page has columns of typical

      business listings with name of business on top, under that address, under that phone, etc.  Each listing is separated

      by one line. There are thousands of listings, and we have to bold the top line of each one. How can we do that

      without doing them individually?

        • 1. Re: How to bold the top line of text on a number of sections of text at once
          Peter Spier Most Valuable Participant (Moderator)

          That's what styles are for. Each of your lines is probably a paragraph, and each type of paragraph should have its own style defined.

          • 2. Re: How to bold the top line of text on a number of sections of text at once
            Sid2363 Level 1

            Picture 8 lines of single spaced text, skip a line, 8 more lines of text, skip a line 8 more lines of text and so on.  Because of the hard enter after every line, every single line in the document is a paragraph.  How do you define the style to be bold on only the first line of every 8 line section.

             

            While mine have 8 lines, there are 2,471 entries similar to this:

             

            ABC Corporation

            123 Main Street

            Hometown, USA 12345

            Phone: 123-456-7890

             

            John Brown's Business

            987 Elm Street

            Ctypark, USA 98765

            Phone: 098-765-4321

             

            We did try styles, and could not make it work - how do we tell it to apply the bold to the top line of each of these 2,471 entries.

            • 3. Re: How to bold the top line of text on a number of sections of text at once
              Peter Spier Most Valuable Participant (Moderator)

              Is every line a paragraph, or is each listing a paragraph with soft returns (forced line breaks)?

               

              This is very simple and a basic operation in either case. It's particularly easy if each listing has the same number of lines, so we'll deal with that case first.

               

              Each line should be a separate paragraph. If you have 4 lines, as your example, you might want to name them Name, Street, City and Phone. You can, and should, base any styles that are going to be similar in appearance on the same base style, and change only the atrributes that are different, so for example if all the lines use the same font, many use the same size and weight, and only the top line is different, and only by being Bold and or larger size, start by defining Street, then base City and Phone on Street, and you don't need to define anything more than the Next Style, which I'll get to in a second.

               

              For the headings, define Name based on Street as well, but change the font weight. Now all of the basic font characteristics can be changed in one place, the Stree style definition.

               

              Since you have the same number of lines in each listing you can set up a "next style" loop. For Name, next style is Street, for Street it's City, for City it's Phone and for Phone it's Name. You'll also want toe add space before to Name, or space after to Phone to make the interlisting blank spaces, and you probably also want to set all but Phone to keep with next line to prevent a listing from breaking across a column or page break. If you currenly have blank lines (empty paragraphs) as the separators, get rid of them. There are find change queries already saved in ID that will do that.

               

              Once the text is in place and the styles are set, you can Select All, then right click on the Name style in the Paragraph Styles panel and choose Apply Name and Next Style. Your entire list will format. IT IS CRITICAL in this method that the structure of every listing is identical and that there are not blank lines between the listings.

               

              If each line is a paragraph, but ther are differnt line counts, you can probably get by with just two styles, one for the headings oand one for everything else, but the next style tick won't work. If there is something unique that appears in all headings you can use find/change to search for that and change the formatting, but I suspect that won't be the case out in the real world, so there will be some manual work involved.

               

              In the case where a lisitn is a single paragraph with forced line breaks (which is better adapted to the case of unequal numbers of lines per listing) you can set up a nested character style to be applied through one forced line break to make the first line bold, red or anything else you want.

               

              At this point you are probbly noticing that a little planningn ahead is a good idea when doing a directory so that your listings have some sort of coherent stucture that allows for automation. I have no idea whre your text is coming from or how it's getting into ID. If it can be set up as a .csv or tab-delimited text file you can use Data Merge to populate a file based on a merge template (which is how I build directories for my clients that need them). You can assign styles in the template to each field or paragraph that contains multiple fields, and Data Merge will remove blank lines if all the fields in a line are null and there is no punctuation or white space on the line.

               

              A multiple records per page merge will give you individual text frames for each record, and you can, if you need to, thread these together using the Text Stitch script from Rorohiko.com.

              • 4. Re: How to bold the top line of text on a number of sections of text at once
                peter minneapolis Level 4

                Sid2363 wrote:

                 

                Picture 8 lines of single spaced text, skip a line, 8 more lines of text, skip a line 8 more lines of text and so on.  Because of the hard enter after every line, every single line in the document is a paragraph.  How do you define the style to be bold on only the first line of every 8 line section.

                 

                While mine have 8 lines, there are 2,471 entries similar to this:

                 

                ABC Corporation

                123 Main Street

                Hometown, USA 12345

                Phone: 123-456-7890

                 

                John Brown's Business

                987 Elm Street

                Ctypark, USA 98765

                Phone: 098-765-4321

                 

                We did try styles, and could not make it work - how do we tell it to apply the bold to the top line of each of these 2,471 entries.

                It would help to know where the stuff originates? Database, spreadsheet, plain text?

                 

                Regards,

                 

                Peter

                _______________________

                Peter Gold

                KnowHow ProServices