954,600 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Search and Replace/Remove Text

I'm trying to reduce a large number of pdf files to text format. Acrobat has a batch processing feature that will convert the files, and also allows a JavaScript to be executed as part of the conversion process. I would like to add JavaScript code that allows me to replace and/or remove certain text/characters from the file.

Examples would be:
A) Remove all double, triple, multi-spaces and carriage returns
B) Change all uppercase characters to lowercase
C) Remove all punctuation

What i'm really aiming for is to be able to run the batch process in Adobe, then have a javascript filter out all that junk within a file with X amount of lines, not just one.


I've very new to JavaScript, so I appologize in advance.

Chimunda
Newbie Poster
3 posts since Jun 2011
Reputation Points: 10
Solved Threads: 0
 

For B, there is .toLowerCase() . For A and C, you could use a regular expression. Hint: \s stands for whitespace :)

twiss
Veteran Poster
1,005 posts since Apr 2010
Reputation Points: 177
Solved Threads: 101
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: