Logo 
Search:

Unix / Linux / Ubuntu Forum

Ask Question   UnAnswered
Home » Forum » Unix / Linux / Ubuntu       RSS Feeds

Recursively renaming with incrementation

  Date: Feb 06    Category: Unix / Linux / Ubuntu    Views: 365
  

I have a few thousand pictures that I have rename for a project.

DSC_0120.jpg to something useful like season_game_year.jpg

I have a php script that does this while making a copy and resizing
them. I ran into a problem where, for some reason, the script isnt
taking the pictures in order from the folder. I dont know how its
getting its order but its causing a problem. Say picture 4, 5, and 6
go together in sequence. When after conversion they are 4, 50 and 524
- or something crazy like that.

So Im going at this a different way.

How can I recursively rename and increment the names of image files?

DSC_001.jpg to Fall2009_Sept11_001.jpg

and so on through the folder?

Share: 

 

6 Answers Found

 
Answer #1    Answered On: Feb 06    

The files are already incremented right?

For example in:
>
> DSC_0120.jpg

The 0120 is the incremment. So the simplest way would be to loop a mv
rename such as the following example from a quick terminal session:

:~/test$ touch foo_1.jpg foo_2.jpg foo_3.jpg
:~/test$ ls
foo_1.jpg foo_2.jpg foo_3.jpg
:~/test$ for i in foo*; do mv "$i" wedding"${i/foo}"; done
:~/test$ ls
wedding_1.jpg wedding_2.jpg wedding_3.jpg


Does that work for you? or was your needs more complicated? I think I
originally took that example from Debian-administration.com... (that's what
I have bookmarked anyway) ...

 
Answer #2    Answered On: Feb 06    

I use Gwenview.
Navigate to the photo directory. Select all. Click on the Plugins
dropdown menu. Go to Plugins. And select Rename. Done.

 
Answer #3    Answered On: Feb 06    

does it rename them in order?

 
Answer #4    Answered On: Feb 06    

I have used GPRename - I think that it can do what you ant out the box.

 
Answer #5    Answered On: Feb 06    


Yes it does.............................

 
Answer #6    Answered On: Feb 06    

I like this app you found.

This makes my life SOOOOO much easier.

 
Didn't find what you were looking for? Find more on Recursively renaming with incrementation Or get search suggestion and latest updates.