Complex file renaming
I have spent quite a bit of time trying to understand how to do this but I have to admit I am a scripting newbie. I have read about sed, tr, rename and gawk. I'm a bit overwhelmed with all the info. This is what I am trying to accomplish. I have a list of files:
background_jpg_jpg.jpg
background01_jpg_jpg.jpg
backdrop_jpg_jpg.jpg
scenery_jpg_jpg_jpg.jpg
The end result that I am trying to get to is this:
background.jpg
background01.jpg
backdrop.jpg
scenery.jpg
The information that I have found 'Googling' is about renaming extensions or putting files in sequence or is very convoluted. Any constructive help is greatly appreciated, not to mention I write stuff like this down in my "Cheatsheet Notebook" for future reference.
EDIT: Did I mention that it's about 400 files?
Last edited by Imyrryr; 04-28-2005 at 09:13 PM.
|