Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Renaming picture in folders...

Reply
Thread Tools

Renaming picture in folders...

 
 
vincenzo.bacarella@gmail.com
Guest
Posts: n/a
 
      01-04-2006
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.

 
Reply With Quote
 
 
 
 
Paul Lalli
Guest
Posts: n/a
 
      01-04-2006
wrote:
> 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

 
Reply With Quote
 
 
 
 
vincenzo.bacarella@gmail.com
Guest
Posts: n/a
 
      01-04-2006
OK, but do you know a script already written? This should be a very
popular issue.

Thanks,

V.B.


Paul Lalli ha scritto:

> wrote:
> > 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


 
Reply With Quote
 
Paul Lalli
Guest
Posts: n/a
 
      01-04-2006
wrote:
> Paul Lalli ha scritto:
>
> > 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
> >

> 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

 
Reply With Quote
 
Randal L. Schwartz
Guest
Posts: n/a
 
      01-04-2006
>>>>> "vincenzo" == vincenzo bacarella <> writes:

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

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
 
Reply With Quote
 
usenet@DavidFilmer.com
Guest
Posts: n/a
 
      01-04-2006
Randal L. Schwartz wrote:
> 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Renaming an Uploaded Picture File Doug H Perl Misc 5 03-15-2010 06:31 AM
Problem with picture on SD card - can't delete bad picture Harlen Ng Digital Photography 8 11-11-2005 08:47 PM
Printing file number and picture number with picture Ace Digital Photography 2 09-17-2005 09:15 AM
Need opinions - good picture - bad picture utseay@aol.com Digital Photography 22 03-17-2005 08:01 AM
Help taking a picture of a glossy picture (Q-60 profiling) Fanta Digital Photography 3 08-31-2003 09:27 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57