Question Locked

Automation of renaming multiple documents

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

In my current project, people require multiple documents to be scanned to PDF format.

The scanner scans a drawing, sheet, letter, and names them with the date and a number.
An example for today (April 29) would be : 20080429199899923.pdf - where the rest of the numbers would be the 'serial' of the scan.

As one could imagine, this is rather time consuming.

These documents would need to be renamed to a drawing number or a project / revision number.
Considering the volume (for any given project the documents are at least 1500 or more) the
company is looking into an automated process for this.

Does anyone know of a software tool, that you can set beforehand to rename any given batch to a certain predefined standard? With subsequential numberings etc?

Or, possibly, program the Nashuatec scanner to use a certain name/number sequence for a batch of documents?

Or any other possible solution ?

Any thoughts and comments would be appreciated.

5 replies

by bizzo

This script will rename up to 9999 files for your given prefix (todays date?) to your required prefix, plus a sequential number.

It takes two parameters, eg, if you call the script seqnum.bat, running

seqnum 20080429 Project

Will rename all pdf files prefixed with 20080429 to Project0001.pdf, Project0002.pdf etc

I've commented out the actual rename command and put an echo in for you to test.

One thing for you to remember though, this needs to be run in a cmd enviroment with delayed environment variable expansion turned on, use

cmd /V

Otherwise the sequential numbering won't work.

Here's the script:

@echo off

set seq=0

for %%F in ("%1*.pdf") do (

set /a seq+=1
if !seq! LSS 10000 set pad=
if !seq! LSS 1000 set pad=0
if !seq! LSS 100 set pad=00
if !seq! LSS 10 set pad=000

echo Renaming %%F to %2!pad!!seq!.pdf
rem rename %%F %2!pad!!seq!.pdf

)

by Member 22220486

Very quick response. I was thinking in the same way.
A bit modification. We can get current date here by %date% or using following command. What do you think?

for /F "tokens=2-4 delims=/- " %%A in ('date/T') do set sysDate=%%C%%A%%B

This discussion is closed to new replies.