• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Applying Styles to Addresses Returns Wrong Results

Community Beginner ,
Oct 19, 2017 Oct 19, 2017

Copy link to clipboard

Copied

I am working on a directory of addresses and want them to have at least 2 different styles. I have tried Next and Nested Styles and have returned results but cannot figure out why it recognizes the 3rd line as the same as the first. I have read numerous tutorials and watched videos on how to but no help. I have removed formatting and tried importing Unformatted text because it looks like it's a hard return or "paragraph" issue but can't remove the line breaks because then the addresses are on the same line. There isn't a specific "trigger" for Nested Styles to recognize and none of the options in the drop down seem to fix it either. See below for what I want it to look like and what the results are. Any ideas?

Screen Shot 2017-10-19 at 8.20.19 AM.png

Views

243

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Mentor , Oct 19, 2017 Oct 19, 2017

Sorry, your screenshot confuses me a bit, since Hidden Characters are not visible. Saying #2, do you confirm you have additional hard return before every Company Name? Is it how spaces between listings are made?

Again, you said earlier just 2 styles would be enough: one for the titles, and another for the rest body?

If so, then it's easy.

1. Select all listings (Ctrl/Cmd+A), apply your 'body' text paragraph style.

2. Create another style, say, 'title'. We'll apply it to all occurrences of Company Na

...

Votes

Translate

Translate
Community Expert ,
Oct 19, 2017 Oct 19, 2017

Copy link to clipboard

Copied

Next style will work if you set it up correctly.

Style: Company Name > Next Style = Rep Name

Style: Rep Name > Next Style = Address line1

Style: Address Line1 > Next Style = Address line2

Style: Address Line2 > Next Style = Phone number

Style: Phone number > Next Style = Company Name

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 19, 2017 Oct 19, 2017

Copy link to clipboard

Copied

Thank you! This does help a lot. I guess I wasn't taking it far enough. However, it assumes all addresses have 2 address lines. So when applied it, most of them worked great! But I do have some with just a name and number line and some with a 3rd address line or 2 phone numbers. Do I need to handle those manually or is there maybe an additional option or condition I can apply?

Thanks!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 19, 2017 Oct 19, 2017

Copy link to clipboard

Copied

You could use a soft return/line break at the end of the first line of a two line address. (Shift+Enter) That will treat a 2-line address as a single paragraph.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Oct 19, 2017 Oct 19, 2017

Copy link to clipboard

Copied

terris93514379  wrote

... it assumes all addresses have 2 address lines.

All our assumings come from the samples you provide... So please be as much specific as you can.

If there’s no consistent algorithm in your 'blocks’, only GREP can save you from additional manual work.

Let’s begin from the basics: all your blocks reside in one text frame, right? How it looks now, with Hidden Characters showing? Which picture represents it best?

Looks.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 19, 2017 Oct 19, 2017

Copy link to clipboard

Copied

You are correct. I didn't consider the addresses were different lengths until I applied the suggested solution and realized the data itself not the solution, has flaws. #2 reflects it best only consider there are multiple variables such as the ones listed below. And this may not be a complete list of variables. The soft return may be a solution however with a couple hundred listings, it could be labor intensive. I have not used GREP so not sure if that applies here. Thanks,

Company Name

Phone Number

Company Name

Address 1

Phone Number

Company Name

Rep Name

Address 1

Phone Number

Company Name

Rep Name

Address 1

Address 2

Phone Number

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Oct 19, 2017 Oct 19, 2017

Copy link to clipboard

Copied

Sorry, your screenshot confuses me a bit, since Hidden Characters are not visible. Saying #2, do you confirm you have additional hard return before every Company Name? Is it how spaces between listings are made?

Again, you said earlier just 2 styles would be enough: one for the titles, and another for the rest body?

If so, then it's easy.

1. Select all listings (Ctrl/Cmd+A), apply your 'body' text paragraph style.

2. Create another style, say, 'title'. We'll apply it to all occurrences of Company Names.

3. In F/C dialog, use this GREP: \r\r\K.

In Change Format: select your Paragraph Style: title

4. Run query, and you're done.

Here's how:

Title4.gif

After this you may want to run built-in query Remove Trailing Whitespace and apply space before your titles properly, in Paragraph style options.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 19, 2017 Oct 19, 2017

Copy link to clipboard

Copied

LATEST

It wasn't a screenshot.  I just typed it in. But yes, there is a hard return on every one. I'm not sure how or why it worked but it did work for all but 2 and at this point, that is great news and not really concerned about why there was a stubborn 2. I'm going to make a point to learn more about GREP. Thank you all for your help.

P.S. I want to say too that the first solution by Barb is correct and works great also as long as the file you are working with has data integrity. Thank you,

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines