With Applescript (script provided by Apple) or File Buddy it's easy to
trim a fixed sequence of characters from a bunch of files.
What I am going to need to do is to remove date stamps from a whole
bunch of files. So a fixed number of characters but variable characters,
all numbers. A trim of a specified number of charaacters would be fine.
Are there any (preferably free) scripts or programs to do this?

Signature
http://www.decohen.com
Send e-mail to the Reply-To address;
mail to the From address is never read
Tom Stiller - 09 Oct 2006 15:51 GMT
> With Applescript (script provided by Apple) or File Buddy it's easy to
> trim a fixed sequence of characters from a bunch of files.
[quoted text clipped - 4 lines]
>
> Are there any (preferably free) scripts or programs to do this?
If you're comfortable with regular expressions, the script below will do
the job.
------------------- cut here ----------------------------------
#!/usr/bin/perl
# Usage: rename perlexpr [files]
($op = shift) || die "Usage: rename perlexpr [filenames]\n";
if(!@ARGV) {
@ARGV = <STDIN>;
chop (@ARGV);
}
for (@ARGV) {
$was = $_;
eval $op;
die $@ if $@;
rename($was, $_) unless $was eq $_;
}
------------------- cut here ----------------------------------

Signature
Tom Stiller
PGP fingerprint = 5108 DDB2 9761 EDE5 E7E3
7BDA 71ED 6496 99C0 C7CF
Gerry - 09 Oct 2006 17:07 GMT
> With Applescript (script provided by Apple) or File Buddy it's easy to
> trim a fixed sequence of characters from a bunch of files.
[quoted text clipped - 4 lines]
>
> Are there any (preferably free) scripts or programs to do this?
I have an Apple supplied AppleScript that is labeled "Trim n Characters
From Selected Items" You have the option to enter the number of
characters you want to remove, either from the beginning or end of the
file name.
I got all the scripts I use either from the AppleScript web page, or
from earlier OS CDs that had "Extras" which included various scripts.
ryrtr - 10 Oct 2006 01:20 GMT
> With Applescript (script provided by Apple) or File Buddy it's easy to
> trim a fixed sequence of characters from a bunch of files.
[quoted text clipped - 4 lines]
>
> Are there any (preferably free) scripts or programs to do this?
i think this will do that : http://petermaurer.de/nasi.php?section=filelist
Daniel Cohen - 10 Oct 2006 15:59 GMT
Many thanks.
> > With Applescript (script provided by Apple) or File Buddy it's easy to
> > trim a fixed sequence of characters from a bunch of files.
[quoted text clipped - 6 lines]
>
> i think this will do that : http://petermaurer.de/nasi.php?section=filelist

Signature
http://www.decohen.com
Send e-mail to the Reply-To address;
mail to the From address is never read