Skip to main content
mr21282609
Participant
November 16, 2023
Answered

Using GREP for tracking in tables

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:

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!

This topic is closed to new replies. Start a new post to keep the conversation going.
LaubenderCorrect answer
Community Expert
November 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-space-when-exporting-to-pdf/m-p/12948283#M477550

 

And my reply in the same thread:

https://community.adobe.com/t5/indesign-discussions/indesign-kerning-and-tracking-converted-to-white-space-when-exporting-to-pdf/m-p/12949794#M477675

 

Regards,
Uwe Laubender
( Adobe Community Expert )

8 replies

Robert at ID-Tasker
Legend
November 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
Community Expert
November 17, 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
LaubenderCommunity ExpertCorrect answer
Community Expert
November 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-space-when-exporting-to-pdf/m-p/12948283#M477550

 

And my reply in the same thread:

https://community.adobe.com/t5/indesign-discussions/indesign-kerning-and-tracking-converted-to-white-space-when-exporting-to-pdf/m-p/12949794#M477675

 

Regards,
Uwe Laubender
( Adobe Community Expert )

Translate
mr21282609
Participant
November 17, 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
Community Expert
November 16, 2023

Instead of GREP style use a Nested style

 

You have to insert a Space where highlighted

Before

After

 

 

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

 

 

You Change the Paragraph Style to alter it 

 

 

 

 

 

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

 

 

Translate
mr21282609
Participant
November 17, 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