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

Acrobat split field into other fields between repeating delimiters

Explorer ,
Aug 05, 2024 Aug 05, 2024

Copy link to clipboard

Copied

I would like to split up this text into seven fields. There are always seven sections. However the delimeters for each section vary. Don't know if this is too complicated to accomplish with a custom validation script. Thank you in advance!!!:

 

SECTION1/TEXT HERE SPACES VARY UP UNTIL LAST SPACE SECTION2/TEXT HERE SPACES VARY UP UNTIL LAST SPACE SECTION3/TEXT HERE UP UNTIL END OF LINE NO SPACE

SECTION4/TEXT HERE SPACES VARY UP UNTIL LAST SPACE SECTION5/TEXT HERE UP UNTIL END OF LINE NO SPACE

SECTION6/TEXT HERE SPACES VARY UPUNTIL LAST SPACESECTION7/TEXT HERE UP UNTIL END OF LINE NO SPACE AND NO FURTHER TEXT

 

Alternative explanation...delimeter pattern (extract each change in color to different field - can be text1, text2, text3, text4, text5, text6, text7):

"/" until last " " of text "/" until last " " of text  "/" until end of line no space

"/" until last " " of text "/" until end of line no space

"/" until last " " of text "/" until end of line no space

Views

218

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

Community Expert , Aug 06, 2024 Aug 06, 2024

To remove the last four characters of a string you can use the substring method, like this:

var a = "abcdefghijk";

a = a.substring(0, a.length-4);

// a is now "abcdefg"

 

As for the location of the code, that depends on what should trigger it. Is this a value that is entered by the user, imported, calculated? Something else?

Votes

Translate

Translate
Community Expert ,
Aug 05, 2024 Aug 05, 2024

Copy link to clipboard

Copied

I've moved this from the Using the Community forum (which is the forum for issues using the forums) to the Acrobat forum so that proper help can be offered.


Scroll down here to see a list of the forums:
https://community.adobe.com/

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
Explorer ,
Aug 05, 2024 Aug 05, 2024

Copy link to clipboard

Copied

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
Community Expert ,
Aug 05, 2024 Aug 05, 2024

Copy link to clipboard

Copied

Do you mean you want to extract just the last word before each "/"? If so, split first by "/", then split each one of those strings by " ". Then take the last element in the arrays of the second split commands.

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
Explorer ,
Aug 05, 2024 Aug 05, 2024

Copy link to clipboard

Copied

Thank you for your question. Essentially I need to extract each iteration of text in between "/" and the last " " before repeating (the text can contain muliple words with spaces). The number of spaces after "/" vary. The sections that I need text extracted  in between "/" and end of line are because the field is formated like a paragraph with 2 carriage returns and of course the end (it is copied and pasted into the field that way for convenience. Also, I'm assuming the end of the line would have some sort of invisible return character, that I'm not sure of. The three line "paragraph" is copied as OCR text and pasted into the field from another PDF). Perhaps there's another way to accomplish this if a validation script may not do the trick?

 

Another way to look at it:

/text_to_last_space   /text_to_last_space   /text_to_carriage_return

/text_to_last_space  /text_to_carriage_return

/text_to_last_space   /text_to_end

 

Much appreciated. 

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 ,
Aug 06, 2024 Aug 06, 2024

Copy link to clipboard

Copied

Split by "/", then trim the excess spaces at the end of each string.

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
Explorer ,
Aug 06, 2024 Aug 06, 2024

Copy link to clipboard

Copied

Thank you for the idea. Could I bother you for the script to remove the last four characters of a string, and am a correct in assuming that the script will be placed in the source field "run custom validation script" window, and that the field referenced in the script will be the field receiving the result? Much appreciated.

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 ,
Aug 06, 2024 Aug 06, 2024

Copy link to clipboard

Copied

To remove the last four characters of a string you can use the substring method, like this:

var a = "abcdefghijk";

a = a.substring(0, a.length-4);

// a is now "abcdefg"

 

As for the location of the code, that depends on what should trigger it. Is this a value that is entered by the user, imported, calculated? Something else?

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
Explorer ,
Aug 06, 2024 Aug 06, 2024

Copy link to clipboard

Copied

LATEST

Thank you very kindly for your script. I was able to input a similar code in the custom calculation script. I appreciate the assistance as always.

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