Weblog entry #1 for a_ashabi
14280_aljuc_1.jpg
14280_aljuc_3.jpg
14280_LBL.jpg
14280_SUP.jpg
100_Fkidbld_3.jpg
110_Fkidbld_1.jpg
1001_Soothing_1.jpg
10100_Half_1.jpg
...
if there is a middle part in the name of the files I want to rename them and delete the middle text.which means I need to have these results:
14280_1.jpg
14280_3.jpg
14280_LBL.jpg
14280_SUP.jpg
100_3.jpg
110_1.jpg
1001_1.jpg
10100_1.jpg
plz help.thanks
Comments on this Entry
file was unexpected at this time
what did I miss?
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
"Files > Multi-Rename Tool or CTRL M as a shortcut"
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
$ a=14280_aljuc_3.jpg
$ echo ${a//_*_/_}
14280_3.jpg
or use renameutils [1] and edit the names (using regexp for example) in vim
[1] http://packages.debian.org/search?keywords=renameutils
regards,
-jhr.
[ Parent | Reply to this comment ]
In a directory containing the files:
mmv "*_*_*" "#1_#3"
Cheers,
rjc
[ Parent | Reply to this comment ]
for file in [0-9]*_*_[0-9]*.*
do
mv $file `echo $file | sed -e 's/\([0-9]*_\)[^_]*_\([0-9]*\)/\1\2/'`
done
[ Parent | Reply to this comment ]