I get bunches of files I need to rename. The original filenames normally have 7 digits - plus an optional character (or two), followed by a space then a whole string of other characters. I need to rename them to be such that the space and everything after it is replaced by '-z'.
For example: (original filenames)
3543679 ggry Hugh highs Bhutto.jpg
6789456 hfghh hfghh death.eps
8753674a hfryg gyjbff hfghh.png
Would become: (renamed filenames) 3543679-z.jpg
Anyone got any ideas how to automate this?