[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Re: file renaming



Reply to note from "Morris Krok"  Tue, 9 Dec
2003 09:06:02 +0200

> What I would also like to know whether U2 contains a program
> that globally enables one to rename all files in a directory
> with say a specific extension such as txt.

No, it doesn't, Morris. RENaming, especially in "batch" mode, can
be such a tricky operation, I'd be loath to automate it.

However... frame RENALL below does just what you describe. Have the
DIRectory display of the files to be RENamed in the current window
and issue RENALL newname.ext. The listed files are RENamed
(one by one, after confirmation for each file) to newname1.ext,
newname2.ext, etc. If the REName command returns an error at any
point in the operation, the program reports it and quits.

Be careful what you wish for!

XPLeNCODE v2.0
b-gin [UNTITLED]
{{;5renall}} REName all files in DIRectory display [CLD 12/10
/03][cr|lf]{002};*;    Use with care (and at your own ris
k)![cr|lf]{<}LBa{>}[XH_]{<}IF{<}VA$WS{>}<2!{<}VA|50{>}<1{>}{<
}SV01,[cr|lf]RENALL.PM [CLD 12/10/03][cr|lf][cr|lf]Usage (wit
h DIRectory display in current window):[cr|lf]RENALL newname[
{046}ext][cr|lf][cr|lf]Operation: After confirmation, RE
Names each listed file to newname1.ext, newname2.ext, etc.[cr
|lf][cr|lf]{>}[JM_]2.ShowSG01[Q2_]{<}EX{>}{<}EI{>}[BX_]es 1[Q
2_]{<}SX01,@upr({<}IS50{>}){>};*;[cr|lf]{<}SX02,{<}VA$DP{>}{>
}{<}SX50,{<}IS02{>}{>}[JM_]2.GetPath[Q2_]{<}SX03,{<}VA@01:1{>
}{>}[BX_]{<}PV03{>}:[Q2_][BX_]cd {<}PV50{>}[Q2_][BX_]dir/fi {
<}PV02{>}[Q2_];*;[cr|lf]{<}SV02,{>}{<}IF{<}IS01{>}{240}"."{>}
{<}SX02,{<}VA@01.2{>}{>}{<}SX01,{<}VA@01.1{>}{>}{<}EI{>};*;[c
r|lf]{<}SX03,0{>}{<}LBb{>}{<}SX04,{<}VA$DR{>}{>}[BX_]exist {<
}PV04{>}[Q2_]{<}IF@not({<}ER{>}){>}{<}SX03,{<}PV03{>}+1{>}{<}
SX05,"REName "+{<}IS04{>}+" to "+{<}IS01{>}+{<}IS03{>}{>}{<}I
F{<}VA|02{>}>0{>}{<}SX05,{<}IS05{>}+"."+{<}IS02{>}{>}{<}EI{>}
{<}SX05,{<}IS05{>}+"? y|N|Esc"{>}{<}PR|@05{>}{<}SX05,{<}RK{>
}{>}{<}IF{<}VA$KC{>}<2{>}{<}PRQuit{>}{<}EX{>}{<}EI{>};*;[cr|l
f]{<}IF{<}VA$KC{>}==21{>}[BX_]ren {<}PV04{>} {<}PV01{>}{<}PV0
3{>}.{<}PV02{>}[Q2_];*;[cr|lf]{<}IF{<}ER{>}{>}{<}SV50,{>}[JM_
]2.Errcode[Q2_]{<}EX{>}{<}EI{>}{<}EI{>}[LD_]{<}GLb{>}{<}EI{>}
[BX_]dir/fi {<}PV01{>}*{<}IF{<}VA|02{>}>0{>}.{<}PV02{>}{<}EI{
>}[Q2_]{<}PRDone{>}{002}[cr|lf][cr|lf]
-nd
XPLeNCODE

--
Carl Distefano
cld@xxxxxxxx