Keeping a specific portion of a filename
Hello, I am trying to figure out how to rename my pdf files to a specific number that resides inside of quotes in the filename. I cant seem to figure this out. The example filename is below. The portion I want to keep is 166013 and rename the file to 166013.pdf.
October 01, 2026 Inspections Small Photos and Scoring 'test' on 'test '166013'' of 9_30_2026 6_51_40 AM.pdf
I have tried to use remove not numbers and remove positions but Im always adjusting it because the dates are dynamic as well as the number string inside the quotes.
TIA
October 01, 2026 Inspections Small Photos and Scoring 'test' on 'test '166013'' of 9_30_2026 6_51_40 AM.pdf
I have tried to use remove not numbers and remove positions but Im always adjusting it because the dates are dynamic as well as the number string inside the quotes.
TIA
Reply to #1:
Hello gsid,
Based on that one example, a simple "Replace" method should work. Set:
Replace: ^.+?['"](\d+)['"].*$
Replace with: $1
Occurrence: All
Case sensitive - not checked
Use regular expressions - checked
Apply to: Name
For an explanation of that particular regex, visit https://regex101.com/r/cAZe43/1/substitution
Regards,
Randy
Hello gsid,
Based on that one example, a simple "Replace" method should work. Set:
Replace: ^.+?['"](\d+)['"].*$
Replace with: $1
Occurrence: All
Case sensitive - not checked
Use regular expressions - checked
Apply to: Name
For an explanation of that particular regex, visit https://regex101.com/r/cAZe43/1/substitution
Regards,
Randy
Reply to #2:
That worked perfectly! Thank you Randy!!
That worked perfectly! Thank you Randy!!