rename

L

luc

I frequently have to rename files like "MyPiCiNPaRiS.jpg" and I'm really
annoyed with the fact that sometimes there are hundreds of them. Is there a
program out there for xp that can help me automatically rename these files
into all small case?
 
X

Xaonon

luc said:
I frequently have to rename files like "MyPiCiNPaRiS.jpg" and I'm really
annoyed with the fact that sometimes there are hundreds of them. Is there
a program out there for xp that can help me automatically rename these
files into all small case?

$ perl -e 'rename $_, lc $_ for @ARGV' *.jpg

Add error code and checks for pre-existing files as appropriate.
 
P

Peter J. Acklam

Xaonon said:
$ perl -e 'rename $_, lc $_ for @ARGV' *.jpg

Add error code and checks for pre-existing files as appropriate.

There is no point in checking for pre-existing files here, since
if "MyPiCiNPaRiS.jpg" exists, then "mypicinparis.jpg" exists, but
it is actually the same file.

Peter
 
X

Xaonon

Peter J. Acklam <[email protected]> said:
There is no point in checking for pre-existing files here, since
if "MyPiCiNPaRiS.jpg" exists, then "mypicinparis.jpg" exists, but
it is actually the same file.

At least until someone tries to use the same code on a system where "foo"
and "Foo" are distinct files. That's what "as appropriate" means.
 
P

Peter J. Acklam

Xaonon said:
At least until someone tries to use the same code on a system
where "foo" and "Foo" are distinct files. That's what "as
appropriate" means.

I know what "as appropriate" means. I was only pointing out
that in this case it was not appropriate, and why it was not
appropriate.

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,266
Messages
2,571,090
Members
48,773
Latest member
Kaybee

Latest Threads

Top