Thread: How to rename multiple files with only parts of the original name in the new name
hi,
me find way rename file different name containing parts of old name?
example:
original file name: filename1.abc.xyz.some.other.stuff
final file name: filename1.abc.xyz
length of file name not constant
abc.xyz not constant format (three numbers.three numbers)
.some.other.stuff not constant , want rid of
appreciated.
thank you!
hiya. maybe create script operation:
if works, replace "echo $newfilename" "mv $oldfilename $newfilename"code:#!/bin/sh files=`ls /path/to/files/` oldfilename in $files ; newfilename=`echo $oldfilename | sed "s/\(.*\.[0-9][0-9][0-9]\.[0-9][0-9][0-9]\)\..*/\1/"` echo $newfilename done
Forum The Ubuntu Forum Community Ubuntu Official Flavours Support General Help [SOLVED] How to rename multiple files with only parts of the original name in the new name
Ubuntu
Comments
Post a Comment