我在一个文件夹中有大约100个文件。我想重命名这些文件。文件的格式是这样复杂文件重命名
AB1234.gif
B3245.gif
AB2541.gif
AB11422.jpg
等..
输出文件SHLD是
AB-0111-1.gif
B-0111-2.gif
AB-0111-3.gif
AB-0111-4.jpg
逻辑将
for(int n=0;n<files.count;n++){
if(file is starting with AB)
fileName = AB + "-0111" + n;
if(file is starting with B)
fileName = B + "-0111" + n;
}
这事可能与PowerShell脚本?
既然您已经说明了您在找什么,您可以使用zdan发布的答案。从你原来的文章中,我以为你正在寻找更复杂的东西。 – Mark 2011-01-08 02:42:16