--- In [email protected], [EMAIL PROTECTED] wrote:
> I was going to build a file renamer script...but I thought I'd ask
if there
> was one out there already.
>
> I'm trying to rename .wma files that are created by a program that
include
> the day name in the file's name.
>
> Eg
> C:\radio_Mon_080105.wma
> Rename to
> C:\radio_080105.wma
>
> I'm just going to do a replacechars() for each day of the week. I'm just
> looking for a script that loads all the files c:\music\*.wma and
runs the
> replacechars() to each item matching that list.
There could be at least two way:
(I haven't tested these, so you should test them first)
1) Using AllFiles
; all in 1-line below
File.AllFiles(?"c:\music\*.wma",?'regex.replace(_file_,"_.*?_","_","_new_")
++File.Move(_file_,_new_)')
;all in 1-line above
2) Using ListFiles
local onames,nnames,_lines_,i
; all in 1-line below
regex.replaceg(assign("onames",File.ListFiles(?"c:\music\*.wma")),
"_.*?_","_","nnames")
; all in 1-line above
_lines_ = line(onames,0)
for(i=1;i<=_lines_;i=i+1)
File.Move(onames(i),nnames(i))
endfor
quit
------------------------ Yahoo! Groups Sponsor --------------------~-->
<font face=arial size=-1><a
href="http://us.ard.yahoo.com/SIG=12h4g80fq/M=362329.6886308.7839368.1510227/D=groups/S=1706030409:TM/Y=YAHOO/EXP=1124376139/A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?page_id=1992
">Fair play? Video games influencing politics. Click and talk back!</a>.</font>
--------------------------------------------------------------------~->
Attention: PowerPro's Web site has moved: http://www.ppro.org
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/power-pro/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/