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

can GREP count?

Participant ,
Aug 24, 2022 Aug 24, 2022

Copy link to clipboard

Copied

Hi there,

 

I need to run a search&replace script in the following example text, do some GREP stuff and replace the x within the brackets with a line number (iterations):

 

item[x] apple

item[x] banana

item[x] cherry

 

and want to obtain this:

 

item[1] apple

item[2] banana

item[3] cherry

 

Is that possible at all? Can GREP count or output i (iteration)?

 

Thanks for your ideas,

Ralf

TOPICS
Scripting

Views

97

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

Participant , Aug 24, 2022 Aug 24, 2022

Found a solution:

I've set up an enumeration paragraph format. It's an additional single step but that works just fine for me.

Thx everyone for your kind help.

Ralf

Votes

Translate

Translate
Community Expert ,
Aug 24, 2022 Aug 24, 2022

Copy link to clipboard

Copied

I don't think so. What is the logic to obtain the values 1,2,3 etc? Probably you would need a script instead of just a Grep expression.

-Manan 

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
Participant ,
Aug 24, 2022 Aug 24, 2022

Copy link to clipboard

Copied

Thx Manan, what might a script look like? I need the values to prepare for a javascript in Acrobat.

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
Participant ,
Aug 24, 2022 Aug 24, 2022

Copy link to clipboard

Copied

LATEST

Found a solution:

I've set up an enumeration paragraph format. It's an additional single step but that works just fine for me.

Thx everyone for your kind help.

Ralf

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