Python Forum
Extract Info from file to rename file
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extract Info from file to rename file
#1
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?
Reply
#2
Yes, it is.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#3
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?
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#4
The file is PDF and OCR will be required.
Reply
#5
See saram.
I came across this program today. I don't have it though because I don't need it.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Rename first row in a CSV file James_S 3 523 Dec-17-2023, 05:20 AM
Last Post: James_S
  file open "file not found error" shanoger 8 942 Dec-14-2023, 08:03 AM
Last Post: shanoger
  Input network device connection info from data file edroche3rd 6 913 Oct-12-2023, 02:18 AM
Last Post: edroche3rd
  Need to replace a string with a file (HTML file) tester_V 1 699 Aug-30-2023, 03:42 AM
Last Post: Larz60+
  How can I change the uuid name of a file to his original file? MaddoxMB 2 868 Jul-17-2023, 10:15 PM
Last Post: Pedroski55
  What is all the info in the info window in Idle? Pedroski55 3 647 Jul-08-2023, 11:26 AM
Last Post: DeaD_EyE
  rename file RolanRoll 0 507 May-18-2023, 02:17 PM
Last Post: RolanRoll
  '' FTP '' File upload with a specified string and rename midomarc 1 1,104 Apr-17-2023, 03:04 AM
Last Post: bowlofred
  Reading data from excel file –> process it >>then write to another excel output file Jennifer_Jone 0 1,046 Mar-14-2023, 07:59 PM
Last Post: Jennifer_Jone
  Extract file only (without a directory it is in) from ZIPIP tester_V 1 926 Jan-23-2023, 04:56 AM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020