Python Forum

Full Version: Extract Info from file to rename file
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I just found Python a few days ago while looking for a way to rename files and it looks very promising. I would like to rename individual files once they are extracted from a larger file. These files are large format drawings and I want to use the drawing number and drawing name to rename the file. The problem as I see it is that the information is not in a certain line or a group of characters in the document but is a group of characters in a certain location on the drawing and this location can vary depending on the firm that created the drawing. The following is how I would like to setup the new file name:

Numbering prefix - 3 digit number that can be incremented by 1's, 5's, or 10's

Drawing Number - Located in the same position on all drawings for a specific project but has various configurations (ex. A100, S-100, M100B-14, etc).

Drawing Title - Located in the same position on all drawings for a specific project but may be multiple lines and may be oriented horizontally or vertically on the drawing.

Is it possible to use Python to create a program that will rename files based on these parameters?
Yes, it is.
Certainly it's possible, but may be not so trivial. What is the file format? Is it possible to extract that information as text or you will need to use OCR?
The file is PDF and OCR will be required.
See saram.
I came across this program today. I don't have it though because I don't need it.