Rename pdf files based on content
ConfirmConversions Options. Shapes If sh. Count If sh. GroupItems i. GroupItems 4. Improve this question. Josh Ng Josh Ng 11 11 bronze badges.
This is highly depending on the content of the PDF. You could try to open the PDF with Word and search for the term Feedback and read the remainder of the line. Don't forget to close the file without saving!
But I have files tho. Although, the position of the text are always the same. I just need the name — Josh Ng. If you can do it with one file, you can do it with all files - just loop over all files using the Dir -command or a FileSystemObject - tons of examples on SO and everywhere.
Tired of workflows that require you to rename PDF files or documents? Automate such tedious manual tasks with Nanonets data entry automation. But PDF file names are not standardized.
The file names often have nothing to do with the underlying content of the document. It is not uncommon for organizations to receive PDF documents with a string of unintelligible characters for a file name.
For example, organizations often receive invoices or proforma invoices as PDF files. Vendors follow different file naming conventions and invoicing formats.
A standardized file naming protocol would make life so much easier - e. Organizing or identifying invoices renamed in this format would be so much more convenient and practical. For all practical concerns, they might have their own rules, or worse none at all. Community Pick: Many members of our community have endorsed this article. Editor's Choice: This article has been selected by our editors as an exceptional contribution.
Experts with Gold status have received one of our highest-level Expert Awards, which recognize experts for their valuable contributions. Published: Updated: Edited by: Andrew Leniart. Article Update March I removed the full source code and the code snippets. The article that remains should act as a "design roadmap" for members who want to write the code in the programming language of your choice.
If you are interested in discussing the program further, please contact me via the EE message system. A recent question here at Experts Exchange piqued my interest, so I decided to provide a thorough solution and publish this Article about it.
The Original Poster OP of the question has approximately one thousand PDF files containing 7-character sequential alphanumeric file names and, of course, all of the file extensions are PDF. Although the OP did not state this, it is likely that the sequential alphanumerics represent unique identifiers for his customers, perhaps customer numbers.
The alphanumeric file name is cryptic, in no way identifiable with the customer, so the OP would like the file name to contain the customer name in addition to the number. For example, a file might be named: D PDF The customer name always begins in column 16 on the first line of the first page in the PDF file and runs to the end of the line.
The program documented in this Article and provided in source code performs this function. Two excellent freeware products are needed for this solution — the AutoHotkey scripting language the program is written in this and the Xpdf package to convert the PDF files to text so the program can extract the customer names for renaming the files.
The script looks for this file in Program Files and Program Files x86 , but you may put pdftotext. The program generalizes the solution by allowing any number of characters in the original file name for the OP it is 7 and any starting column number for the string that will be in the new file name for the OP it is For example, the string that will be in the new file name may be on some line other than the first; or the string may be in a variable column number preceded by a string that identifies it, such as Account Number:.
By providing the source code, you may modify the program to parse the text extracted from the PDF files in order to create the new file names.
0コメント