This is a discussion on renaming and number padding using directory as guide, help within the Shell scripting forums, part of the Development/Scripting category; I need to take a series of image files, all numbered consecuativly, that were recently dumped in a directory and ...
|
|||||||
| Register | FAQ | Members List | Calendar | Forgotten your password? | Mark Forums Read |
|
|||
|
I need to take a series of image files, all numbered consecuativly, that were recently dumped in a directory and rename them to pieces of the directories path. Assume all directories are structured as this one so that I may use this script to easly sort and rename files.
pt.1 path : /home/shots/pic/seasons/winter/snowy I need the script to recognize pieces of the path as variables to the images new name. pt.2 path : /home/$NAME/pic/seasons/$SEASON/ I then need the file which is named xyxy.1.tif to be named in the following convention pt.3 name : $NAME_$SEASON.0001.tif the number needs to be repadded with 4 digits I have been hacking at it for the past two days and have comeup with a rather large mess and have finally broken down and called out for help. I had it half working in Perl my knowlege of that is even more limited then the BASH shell. Thanks |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Guide to configure Linux Mail Server | javed | Mail Servers | 0 | 12-24-2007 12:59 PM |
| UNIX Display or list number of files in a current directory | raj | Getting started tutorials | 1 | 12-07-2007 11:55 AM |
| Structured cabling Guide | ssent12 | Computer Networking and Internet/broadband | 4 | 06-11-2007 04:59 PM |
| Number of Visits in AWStats! | honey bee | Linux software | 3 | 04-01-2006 10:51 PM |
| Plz Guide Me... | kartheekpn | Shell scripting | 3 | 05-18-2005 08:01 PM |