On 8/10/2004 3:58:30 PM, Christian Ziemski wrote:
>On Tue, 10 Aug 2004 11:51:00 -0400,
>Patrick Carroll wrote:
>
>>Can someone point me in the right direction for a macro which will
>>search a directory and rename files.
>>
>>I have a directory with several thousand files. The files do not
>>have a consistent naming methodology which I want to correct.
>
>Patrick:
>
>I tried to describe one possible
>solution in words.
>But then realized that it nearly was
>pseudo code.
>
>And so I deleted my posting again and
>rewrote it in VEDIT macro language.
>
>It's attached as ready-to-run macro.
>
>But of course you have to change it
>regarding your directory name
>and you should test it before using it
>in production environment!!!
>For easier testing I included some lines
>(and I disabled the Rename-command for
>security ...)
>
>The macro is documented. So you should
>be able to understand its technique. If
>you have any questions: let us know
>here.
>
>
>Christian
Christian's macro will create a list of changed filenames, but lacks some essential error checking.
You may wish to include the following in Christian's macro.
if(File_Exist(@(104))==0)
{
File_Rename(@103,@104)
}
else // make name unique or display error
{
}
Return
|
|