I have several hundred files that have been retrieved from a content mangagement
system that munged the filenames.The files are all named Rendition-XX_orig_file.name
I'm sure there is a two line perl or other scripty language that can
rename the files back to orig_file.name, but I'm not enough of a perl hacker
to figure it out. Does anyone have a sugguestion that would cause me
to worship your sheer geek foo?
system that munged the filenames.The files are all named Rendition-XX_orig_file.name
I'm sure there is a two line perl or other scripty language that can
rename the files back to orig_file.name, but I'm not enough of a perl hacker
to figure it out. Does anyone have a sugguestion that would cause me
to worship your sheer geek foo?
no subject
Date: 2009-01-10 02:18 pm (UTC)First
"ls -l Rendition* > foo"
Then
"cut -b55-80 foo>foo2"
(adjusting the 55-80 range as needed so you get a list of all your
file names)
Then edit foo2, replacing "Rendition-XX_" with "doit "
Then create an executable file called "doit" that reads
"mv Rendition-XX_%1 %1"
Then make foo2 executable, and execute it.
no subject
Date: 2009-01-10 02:21 pm (UTC)I'm amused at the number of scripts I've written in my life that I called "doit".
no subject
Date: 2009-01-10 02:22 pm (UTC)of %1. Sorry.
no subject
Date: 2009-01-10 03:40 pm (UTC)ls * | perl -ne 'chomp; next unless -e; $old = $_; s/Rendition-\d+_//; next if -e; rename $old, $_;'
I'm pretty rusty and I'm sure there's a better way to do it, but I think that should work. May want to test it on a copy of some of the files first. =)
no subject
Date: 2009-01-12 02:50 pm (UTC)why it didn't work for the others. Are you on any IM type client?