Print Page | Close Window

Remove Punctuation

Printed From: Foxit's Planet PDF Forum
Category: Lets Talk PDF
Forum Name: JavaScript
Forum Description: Discussions relating to the use of JavaScript within PDF.
URL: http://forums.planetpdf.com/forum_posts.asp?TID=1329
Printed Date: 17 Jul 2019 at 1:37pm
Software Version: Web Wiz Forums 11.10 - http://www.webwizforums.com


Topic: Remove Punctuation
Posted By: 281Blue
Subject: Remove Punctuation
Date Posted: 30 Oct 2014 at 1:53pm
Hello, 

i'm new to pdf scripting and was wondering if someone could help me out, please.

I made a form that has a field for the first name and a field for the last name. 

I would like to combine the data from those two fields into a third field, called "file name", which will denote how the ID photo file should be named. 

In the combination process, certain filters need to be applied to each field. In the end, the file name is the first initial, plus the last name. 

The issue is dealing with punctuation, suffixes and hyphenated last names.

Some Examples:

First: John 
Last: Doe
File: jdoe

First: John
Last: Doe Jr.
File: jdoe
* Removes suffix and punctuation

First: John
Last: Doe II
File: jdoe
* Removes suffix

First: John
Last: Doe-Ray
File: jray
*Uses the absolute last name in hyphenated names

First: John
Last: La Ti Do
File: jlatido
*In multi-word last names, spaces are removed

First: John
Last O'Doe
File: jodoe
*Removes punctuation from last name

Thanks for the help.

 




Replies:
Posted By: aandi
Date Posted: 30 Oct 2014 at 2:12pm
It's a pretty big job. What do you have so far?


Posted By: 281Blue
Date Posted: 30 Oct 2014 at 2:39pm
So far, nothing. Just getting started. Debating if I should force a suffix field, but that does not address the absolute last name problem.


Posted By: try67
Date Posted: 30 Oct 2014 at 8:49pm
As mentioned, this would require quite a complex, custom-made script.

If you're interested in someone creating it for you (for a fee), feel free to contact me privately.


-------------
- Acrobat Expert - Contact me personally at try6767@gmail.com
Check out my custom-made scripts website: http://try67.blogspot.com


Posted By: 281Blue
Date Posted: 30 Oct 2014 at 9:32pm
Thanks. I think we figured it out. Making some changes to the form, adding suffix fields and just running some simple removes. 

I appreciate your offer!



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.10 - http://www.webwizforums.com
Copyright ©2001-2017 Web Wiz Ltd. - https://www.webwiz.net