[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] file naming



On Tue, Feb 01, 2000 at 02:26:18PM -0800, Nicholas G. Thornton wrote:
> For the project I've just been assigned, fortunately the person before me had a
> nice orderly naming system for files; unfortunately the client wants a diferent
> standard naming system. namely...
> "file-05-01.jpg"  -> "file-05.s.jpg"
> "file-05-02.jpg"  -> "file-05.t.jpg"
> 
> I was wondering how one would go about automating the changing of their names,
> or more specifically which variable I'd muck around with. I noticed setting $^I
> in one of Chris Nandor's scripts. 

You don't want -i (or $^I, the corresponding special variable).  That
feature is only for saving backups of files processed through @ARGV and <>,
not for simply renaming files.

You want to write a script which parses the filename according to the old
system, creates a new filename according to the new system, and then calls
rename.

Ronald

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org