Challenging Shell Script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have a folder of digital images MV1000.jpg, MV1001.jpg, MV1002.jpg,....
These images correspond to a list of hardware items. This list is in a text file items.txt as follow:


ID     Description              // this line can be removed from the file
500   screw driver philips
501   camera digital canon
502   laser printer samsung
etc...

The image MV1000.jpg corresponds to the first item in the list, i.e. 500 screw driver philips and the second image, MV1001.jpg corresponds to the second item in the list, i.e. 501 camera digital canon and so on.


I want to rename the images in the following way:

The name of each image should be made of: 3 letters which are the first letters of each word in the line from items.txt file (screw driver philips would be sdp) followed by the ID of the item.

For example:




MV1000.jpg  should be     sdp500.jpg
MV1001.jpg  should be     cdc501.jpg
MV1002.jpg should be      lps502.jpg



Thank you

Vick

_________________________________________________________________
Don't just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/

-
: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Newbie]     [Audio]     [Hams]     [Kernel Newbies]     [Util Linux NG]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Device Drivers]     [Samba]     [Video 4 Linux]     [Git]     [Fedora Users]

  Powered by Linux