Renaming picture in folders...

  • Thread starter vincenzo.bacarella
  • Start date
V

vincenzo.bacarella

I have a set of folders with some images in each.

Imaging this:

/Folder_1
/Folder_2
/Folder_3
/Folder_4
... . .

Now, each of those directories has images called with names like
"475849.jpg" I want
to get everyone of those "475849.jpg" recursively and rename their with
names like Folder_x_y where the y
is a progressive number and "Folder_x" is the name of the folder which
contains them.

How can I accomplish this with a fast Linux Perl script? Thanks for the
help.
 
P

Paul Lalli

I have a set of folders with some images in each.

Imaging this:

/Folder_1
/Folder_2
/Folder_3
/Folder_4
.. . .

Now, each of those directories has images called with names like
"475849.jpg" I want
to get everyone of those "475849.jpg" recursively and rename their with
names like Folder_x_y where the y
is a progressive number and "Folder_x" is the name of the folder which
contains them.

How can I accomplish this with a fast Linux Perl script? Thanks for the
help.

What have you tried so far? How did it not meet your goals?

As a starting place, I would suggest reading up on:
perldoc File::Find
perldoc -f rename

Paul Lalli
 
V

vincenzo.bacarella

OK, but do you know a script already written? This should be a very
popular issue.

Thanks,

V.B.


Paul Lalli ha scritto:
 
P

Paul Lalli

Paul Lalli ha scritto:

OK, but do you know a script already written? This should be a very
popular issue.

Please do not top post. Backwards-responses corrected above.

This is not a code repository. Nor is it a place to inquire about
pre-written scripts. This is a place to discuss Perl and help others
learn and debug Perl and Perl programs.

If you want someone to write a script for you, I suggest
http://jobs.perl.org. If you want to find a pre-written script, I
suggest http://www.cpan.org or http://www.google.com.

Paul Lalli
 
R

Randal L. Schwartz

vincenzo> I have a set of folders with some images in each.

You also posted this to perlmonks. And you didn't disclose in each
place that you also posted in the other place.

This is called multi-posting, and is frowned upon, because it makes
two different groups of people unaware of progress made by each other,
and any additional feedback you've given. This wastes resources that
could be spent on other problems.

For example, you already have a complete solution on monks, but people
here might not know that, and would use *their* valuable time creating
a solution that is redundant. This is not your private resource to
waste.

In other words, you're practicing bad net manners. Feh on you.

print "Just another Perl hacker,"; # the original
 
U

usenet

Randal said:
You also posted this to perlmonks.

.... and to perl.beginners... I didn't realize the OP had multiposted
when I responded to him in that group. Oh well - at least I got to hit
him upside the head with my IO::All stick.
 

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

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top