Multiple File Renaming

I have a set if files...

eStmt_01_22_2009.pdf eStmt_02_19_2009.pdf eStmt_03_23_2009.pdf | | eStmt_08_21_2009.pdf

Any nice automated way to rename them as...

eStmt_2009_01_22.pdf eStmt_2009_02_19.pdf eStmt_2009_03_23.pdf | | eStmt_2009_08_21.pdf

Windows Explorer bulk renaming will only use a common name and append a number order :-(

...Jim Thompson

--
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
 Click to see the full signature
Reply to
Jim Thompson
Loading thread data ...

Stuff like this is why I keep a Tcl interpreter around; although with a total of eight files, it's more trouble that it is worth.

-- Les Cargill

Reply to
Les Cargill

When I'm faced with a task like this, I create a batch file to do the work. Word's ability to work with columns (create a table, paste, edit, then export the text or simply remove the table attribute) makes the task a set of global find and replace.

Other better word processors should be able to do the same kind of tricks.

Reply to
PeterD

Powerdesk has this capability.

Jim

"Jim Thompson" wrote in message news: snipped-for-privacy@4ax.com...

Reply to
RST Engineering - JIm

TotalCommander has a multi-file renaming tool. It's not automatic, but relatively painless. Replace _2009 with nothing Replace tmt with tmt_2009

Reply to
spamme0

I had similar needs so I got this...

formatting link

Cheers, John

Reply to
John KD5YI

Batch File (BAT) Visual Basic Script file etc.. And I think Java can also do that.

If you can fine some one nice enough to write one for you.

If it really becomes a problem for you , I could whip up a simple conversion app for you.

I can only assume that you must have a lot of them ?

Reply to
Jamie

"dir /b" piped into a perl script which parses the file names and renames. It most probably can be even be made into a one line which can entirely be run from the command line.

-- Muzaffer Kal

DSPIA INC. ASIC/FPGA Design Services

formatting link

Reply to
Muzaffer Kal

"John KD5YI" : I had similar needs so I got this... :

formatting link
: Cheers, : John

I'll second that. Fast to learn, easy to use, and also handles Regular Expressions to do the challenging changes. Art

Reply to
Artemus

Depends on my level of laziness. You can dump the filenames to a text file with a dir /b >ren.bat then use a real text editor like notepad++ and add the rename to the start of every line and the new name to the end of every line. your filename is already a batch file from step 1

or you can master the intricacies of the for command mixed in with some grep goodness and spend an hour debugging a batch file, and completely forget how the for command works by the next day.

Reply to
a7yvm109gf5d1

Crimson Editor, "learned" macro.

John

Reply to
John Larkin

"Jim Thompson" wrote in message news: snipped-for-privacy@4ax.com...

Is that the exact File name? Then a VB script should do. Batch files are a little more complicated.

Cheers

Reply to
Martin Riddle

You could hand write a batch file to do it.

You could write some VB in an excel spreadsheet (or anywhere else VB is used)that would do a for/if/then routine on them.

Reply to
FatBytestard

Write a program..

Reply to
Robert Baer

Unchecked idea #!/bin/bash for AA in eStmt_*.pdf ; do BB=3D`echo $AA | sed "s/_/_2009_/"` mv $AA $BB done

make the "mv" line read: echo "mv $AA $BB" to check it first

Reply to
MooseFET

Good point! I keep forgetting I have Macro Express resident all the time.

...Jim Thompson

--
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
 Click to see the full signature
Reply to
Jim Thompson

Them be the exact filenames... my bank statements. I've suggested they change their e-Statement naming convention ;-)

...Jim Thompson

--
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
 Click to see the full signature
Reply to
Jim Thompson

As with anyone else who doesn't pander or otherwise suck up to your political philosophies, what I write probably won't be seen by you. But here it is, anyway. (I'm an equal-opportunity poster.)

Unix makes this darned easy. Has for quite some time. Something like this:

rename -n "s!eStmt_(.*)_(.*)_(.*)\\.pdf$!eStmt_$3_$1_$2\\.pdf!"

If Perl is separately installed (and it is readily available under Windows), that can be used as part of a very short program as well.

Or, if you aren't used to DOS (you must be, but perhaps you have moved away from it), then this Windows program is free:

formatting link

I suspect it will do fine. It supports Perl expressions. Screen is busy-looking.

Jon

Reply to
Jon Kirwan

"Jim Thompson" wrote in message news: snipped-for-privacy@4ax.com...

Try the following batch file. Place it in the same directory as the eStmt files. You can run it from the command line: cd c:\\estmt rname

Or click on it in explorer in the estmt directory

It'll create a new directory "renamed' with all the files copied and renamed in that directory.

Cheers

Cut here ___________________________

@echo off SETLOCAL ENABLEDELAYEDEXPANSION

rem name format - eStmt_03_23_2009.pdf rem new format - eStmt_2009_03_23.pdf

Rem create dir for new files if exist renamed goto cont

md renamed

:cont

for %%A in (*.pdf) do (

echo %%A Rem Parse date out of file name for /f "tokens=1-5 delims=_." %%a in ("%%A") do ( set prefix=%%a set month=%%b set day=%%c set year=%%d set ext=%%e

)

Rem Create Newname set newname=!prefix!_!year!_!month!_!day!.!ext! copy %%A "renamed/!newname!" echo File: %%A renamed to: !newName!

)
Reply to
Martin Riddle

That is even easier. When you DL the PDF, you can ALWAYS give it ANY name at the moment the save dialog is up.

So one time, each month, YOU save as whatever name you want.

If you get it in an email, the RIGHT click on the attachment, and do the save as.

Reply to
ChairmanOfTheBored

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.