[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference hydra::amiga_v1

Title:AMIGA NOTES
Notice:Join us in the *NEW* conference - HYDRA::AMIGA_V2
Moderator:HYDRA::MOORE
Created:Sat Apr 26 1986
Last Modified:Wed Feb 05 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:5378
Total number of notes:38326

3718.0. "renaming a bunch of files" by NAC::BRANNON (value added) Wed Apr 25 1990 17:43

    This may be a stupid question, but...
    
    I'm trying to rename a bunch of files foo01.brush, foo02.brush, etc.
    to foo01.br, foo02.br, etc.
    
    Any suggestions on a good way to go about this? 
    
    I tried "with" and "foreach" but they substitute the full filename.
    
    So then I tried paramenter substitution with a batch file.
    
    execute r foo
    
    where r contains:
    
    .KEY <Name1>
    rename Name1.brush Name1.br
    
    (There was very little info in the A2000 manual to guess how to use
     parameter substitution).  This told me it couldn't rename Name1.brush.
    
    sigh...any suggestions, hints, or solutions welcomed.
    
    thanks,
    dennis
    
T.RTitleUserPersonal
Name
DateLines
3718.1AmiShellWHAMMY::SPODARYKBinary ThrottleWed Apr 25 1990 18:338
I'm using the ARP Amishell (replaces the AmigaDOS shell), and this type
of command is real easy.

Shell> rename *.this *.that

Don't know about the standard CLI, though.  

Steve
3718.2Have you tried AREXX?FENRYS::mwmMike (Real Amigas Have Keyboard Garages) MeyerWed Apr 25 1990 18:0810
/* Rename all the files that match a pattern - uses WShell */
/* typed in on the fly, don't trust this */

'list #?.brush | execio stem' files.

do i = 1 to files.0
	say 'doing' files.i
	'rename' files.i left(files.i, length(files.i - 3))
	done
say "All done now."
3718.3V1.3 EnhancerDICKNS::MACDONALDVAXELN - Realtime Software PubsWed Apr 25 1990 19:231
    There is also a method listed in the V1.3 enhancer manual.