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

How to Separate Characters from Imported CSV Fields

Community Beginner ,
Nov 30, 2023 Nov 30, 2023

Hi All -

I am using an online form for contractors to fill out when they join my company and/or become affiliated vendors. The form is then exported to a csv file, which is in turn imported into a bespoke pdf contract we have created.

 

When exporting into our pdf, I need to take their tax id / SSN one character at a time.

eg. SSN = 123 - 45 - 6789 needs to become nine separate fields of 1,2,3,4,5,6,7,8, and 9.

(We use the tax numbers in a few different places in the contracts and they have to be formated a little differently each time, so the individual character export works perfectly for that, if I can pull it off.)

 

I'm thinking there may be a script I can use in the pdf form to accomplish this, but I can't find one anywhere. Any help and/or advice on how to get this done would be really appreciated. Thanks!

TOPICS
Create PDFs , How to , JavaScript , PDF forms
207
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 ,
Dec 01, 2023 Dec 01, 2023
LATEST

Yes, you can use something like this:

var str = this.getField("SSN").valueAsString;
// var str = "123 - 45 - 6789";
str = str.replace(/\s|-/g, ""); // remove dashes and blank spaces
myArray = str.split("");
// console.println(myArray);

Acrobate du PDF, InDesigner et Photoshoptographe
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