I have a folder full of image files such as
- 1500000704_full.jpg
- 1500000705_full.jpg
- 1500000711_full.jpg
- 1500000712_full.jpg
- 1500000714_full.jpg
- 1500000744_full.jpg
- 1500000745_full.jpg
- 1500000802_full.jpg
- 1500000803_full.jpg
I need to rename the files based on a lookup from a text file which has entries such as,
- SH103239 1500000704
- SH103240 1500000705
- SH103241 1500000711
- SH103242 1500000712
- SH103243 1500000714
- SH103244 1500000744
- SH103245 1500000745
- SH103252 1500000802
- SH103253 1500000803
- SH103254 1500000804
So, I want the image files to be renamed,
- SH103239_full.jpg
- SH103240_full.jpg
- SH103241_full.jpg
- SH103242_full.jpg
- SH103243_full.jpg
- SH103244_full.jpg
- SH103245_full.jpg
- SH103252_full.jpg
- SH103253_full.jpg
- SH103254_full.jpg
How can I do this job the easiest? Any one can write me a quick command or script which can do this for me please? I have a lot of these image files and manual change isnt feasible.
I am on ubuntu but depending on the tool I can switch to windows if need be. Ideally I would love to have it in bash script so that I can learn more or simple perl or python.
Thanks
EDIT: Had to Change the file names
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…