经管之家首页 答疑首页 EXCEL/VBA Rename the sequential excel files
  • 统计与数据分析
  • 经济学
  • 管理学
  • 金融学
  • 财会类
  • 国际贸易类
  • 考研考博与考证
  • 找数据和资料
  • 求职与职场
  • 学术与投稿类
  • 社会生活
  • 其它
Hi :
My question: I have many excel files on c:\temp\A0001.xls…..A1000.xls
I want to use Excel to rename A0001.xls…..A1000.xls to B0001.xls…..B1000.xls
ie. (rename B0001.xls= A0001.xls ….. B1000.xls=A1000.xls)
Thanks !

jjjj6666
put this in a dos batch file and run it

@ECHO OFF
SETLOCAL enabledelayedexpansion
FOR /l %%i IN (1,1,1000) DO (
        SET newname=000%%i
        SET newname=!newname:~-4!
        IF EXIST a!newname!.xls (
                ECHO REN a!newname!.xls b!newname!.xls
                REN a!newname!.xls b!newname!.xls
        )
)

回答于 2014/03/21 11:55

0 0

 加载中...