Renaming picture in folders...

Discussion in 'Perl Misc' started by vincenzo.bacarella@gmail.com, Jan 4, 2006.

  1. Guest

    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.
     
    , Jan 4, 2006
    #1
    1. Advertising

  2. Paul Lalli Guest

    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
     
    Paul Lalli, Jan 4, 2006
    #2
    1. Advertising

  3. Guest

    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
     
    , Jan 4, 2006
    #3
  4. Paul Lalli Guest

    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
     
    Paul Lalli, Jan 4, 2006
    #4
  5. >>>>> "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!
     
    Randal L. Schwartz, Jan 4, 2006
    #5
  6. Guest

    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.
     
    , Jan 4, 2006
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark
    Replies:
    0
    Views:
    471
  2. evaisse

    Mass-Renaming folders win32

    evaisse, Oct 28, 2006, in forum: Python
    Replies:
    1
    Views:
    254
    Tim Chase
    Oct 28, 2006
  3. r.swamy4all

    Renaming folders using system("ren ");

    r.swamy4all, Jan 22, 2008, in forum: C Programming
    Replies:
    0
    Views:
    536
    r.swamy4all
    Jan 22, 2008
  4. Doug H

    Renaming an Uploaded Picture File

    Doug H, Mar 13, 2010, in forum: Perl Misc
    Replies:
    5
    Views:
    224
    J├╝rgen Exner
    Mar 15, 2010
  5. Replies:
    8
    Views:
    1,345
    Mick White
    Apr 19, 2005
Loading...

Share This Page