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

Using GREP for tracking in tables

Community Beginner ,
Nov 15, 2023 Nov 15, 2023

Hi,

I have a catalogue with >5000 item numbers. Each item number has between 6 and 14 characters (mostly numbers but sometimes also letters).

For better reading, the item numbers are written in blocks of 2 with a space in between.

Problem: If you copy the item number from a PDF, for example, the spaces will of course also be copied.

So it would be a much better way to change the tracking (is this the correct term? in German it is called "Laufweite") of every 2nd character by using GREP Styles instead of using the spaces.

But there are 2 problems:

 

1) I want to get every 2nd character from the left to the right (character 2, 4, 6, and so on) no matter how many characters the item number has.

With this I get every 2nd character from right to left (I found it in the internet, I'm not good at regex):

 

\w(?=\w{2}\b)|\w(?=(\w{2}){2,}\b)

 

e.g.:

12  34  56

1  23  45  67

 

But i want to have:

12  34  56

12  34  56  7

 

2) The GREP Style only works in text frames but not in tables/cells.

Every item number is written in a seperate cell. It kinda looks like this:

Item Number.jpg

The cells with the item number have the same paragraph style like the text frame.

 

Can anyone help me solve the problems, please? Whereby the second problem is the bigger problem.

 

The catalouge will be created every year with a PIM. The PIM creates everything by using templates and fills it with content. It also optimizes the column width. So it should work with GREP Styles, I think. Find and replace would be not an option beacuse the optimisation of the columns width won't work anymore.

 

Many thanks in advance!

TOPICS
How to
503
Translate
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 2 Correct answers

Community Expert , Nov 16, 2023 Nov 16, 2023

Instead of GREP style use a Nested style

 

You have to insert a Space where highlighted

Before

EugeneTyson_0-1700155558841.png

After

EugeneTyson_1-1700155582944.png

 

 

Then you already need to have Paragraph and Character Styles setup

Apply the Paragraph Style

Then the Character style is triggered by the Nested Style

Targeting the spaces between words

 

EugeneTyson_3-1700155692728.png

 

You Change the Paragraph Style to alter it 

 

EugeneTyson_2-1700155677229.png

 

 

 

 

Test file attached

 

You can do much the same thing with nested styles if you want to target 2 numbers together

Adjust the nested style sequence

 

...
Translate
Community Expert , Nov 16, 2023 Nov 16, 2023

Hi @mr21282609 ,

do you or your customers still intend to copy item numbers from the PDF you exported from InDesign?

I think it makes no difference if there is a blank character or a white space done with tracking regarding the PDF. When the text is copied over from the PDF a blank character will be in the pasted result. This behavior could also differ from PDF reading application to PDF reading application; eg. like Acrobat Reader or Acrobat Pro DC handles this vs. a PDF reader from a browser…

...
Translate
Community Expert ,
Nov 16, 2023 Nov 16, 2023

Instead of GREP style use a Nested style

 

You have to insert a Space where highlighted

Before

EugeneTyson_0-1700155558841.png

After

EugeneTyson_1-1700155582944.png

 

 

Then you already need to have Paragraph and Character Styles setup

Apply the Paragraph Style

Then the Character style is triggered by the Nested Style

Targeting the spaces between words

 

EugeneTyson_3-1700155692728.png

 

You Change the Paragraph Style to alter it 

 

EugeneTyson_2-1700155677229.png

 

 

 

 

Test file attached

 

You can do much the same thing with nested styles if you want to target 2 numbers together

Adjust the nested style sequence

 

It would be something like this

EugeneTyson_4-1700155999213.png

 

 

Translate
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 ,
Nov 16, 2023 Nov 16, 2023

Hi @Eugene Tyson ,

thank you very much. That's much easier then GREP (also esier to understand for my colleagues) and it works!
I never paid any attention to the function before.

Thank you very much!

Translate
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 ,
Nov 16, 2023 Nov 16, 2023

Hi @mr21282609 ,

do you or your customers still intend to copy item numbers from the PDF you exported from InDesign?

I think it makes no difference if there is a blank character or a white space done with tracking regarding the PDF. When the text is copied over from the PDF a blank character will be in the pasted result. This behavior could also differ from PDF reading application to PDF reading application; eg. like Acrobat Reader or Acrobat Pro DC handles this vs. a PDF reader from a browser…

 

I would test the copy/paste process from the exported PDF with different PDF reading apps. Preferable with the ones your customers are using. Hm. I think we already had discussed the problem in this forum. One crucial difference could be if the option PDF Tags is checked in the export dialog of InDesign.

 

See into this discussion:

 

InDesign kerning and tracking converted to white space when exporting to PDF
Javier Gómez Laínez, May 17, 2022
https://community.adobe.com/t5/indesign-discussions/indesign-kerning-and-tracking-converted-to-white...

 

And my reply in the same thread:

https://community.adobe.com/t5/indesign-discussions/indesign-kerning-and-tracking-converted-to-white...

 

Regards,
Uwe Laubender
( Adobe Community Expert )

Translate
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 ,
Nov 16, 2023 Nov 16, 2023

Hi @Laubender ,

Thank you very much for your tip. These are problems that I would never have thought they existed...

Fortunately, my colleagues use Adobe Reader to view the PDFs and copy the product codes.
But it's very good to know that it (very probably) won't work properly with any other application.

Translate
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 ,
Nov 16, 2023 Nov 16, 2023
quote

[...] For better reading, the item numbers are written in blocks of 2 with a space in between. [...]


By @mr21282609

 

When / where / how this space is added?

Before importing to InDesign or after - in the InDesign?

Can you avoid it and then just use Nested Styles?

 

With such long codes - I think 3 or even 4 digits would be better?

Like with phone numbers - split into (+44) 9999 999 999.

 

Translate
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 ,
Nov 16, 2023 Nov 16, 2023

Hi Robert,

when using tracking the space is added when you copy/paste from an exported PDF to another application.

Customers will do this. It is not added, as my tests are showing, when "Tagged PDF" in the export dialog for PDFs is enabled. That goes for PDF reading apps like Adobe Reader or Acrobat Pro. Also for the PDF reading app that comes with Firefox. But one cannot predict the behavior of other PDF readers.

 

Regards,
Uwe Laubender
( Adobe Community Expert )

Translate
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 ,
Nov 16, 2023 Nov 16, 2023

Hi @Robert at ID-Tasker ,

you are right. Such long codes would be easier to read in blocks with 3 oder 4 digits.

But what can I say? It is "historisch gewachsen". That means: It has been like this for decades and (most of) my colleagues don't want to get used to something new... Lazy as fu**...

Sometimes it doesn't help, they have to get used to something new. But if they think it's easier to read in blocks of 2, then let them have it that way.

Translate
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 ,
Nov 17, 2023 Nov 17, 2023
LATEST

I'm not arguing about how it is displayed - too much - I'm just asking when / how those extra spaces are added? 

 

If they can be avoided - you could just space digits with formatting - instead of having physical spaces in between of digits... 

 

Translate
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