楼主: 3qsir
1273 7

[有偿编程] Rename the sequential excel files [推广有奖]

  • 2关注
  • 1粉丝

副教授

52%

还不是VIP/贵宾

-

威望
0
论坛币
13606 个
通用积分
27.0809
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
71836 点
帖子
367
精华
0
在线时间
931 小时
注册时间
2011-5-18
最后登录
2021-3-6

楼主
3qsir 发表于 2014-3-17 09:05:33 |AI写论文
5论坛币
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 查看完整内容

yes, basical, make a text file named as rename.bat and put under c:\test, then under ms_dos, c: cd c:\test rename
关键词:Sequential rename EXCEL Files file question files excel Excel

回帖推荐

jjjj6666 发表于2楼  查看完整内容

yes, basical, make a text file named as rename.bat and put under c:\test, then under ms_dos, c: cd c:\test rename

jjjj6666 发表于3楼  查看完整内容

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 ) )

本帖被以下文库推荐

沙发
jjjj6666 发表于 2014-3-17 09:05:34
yes, basical, make a text file named as rename.bat and put under c:\test, then under ms_dos,

c:
cd c:\test
rename
已有 2 人评分经验 论坛币 学术水平 热心指数 信用等级 收起 理由
客初 + 20 + 20 + 2 热心帮助其他会员
3qsir + 5 + 5 + 5 热心帮助其他会员

总评分: 经验 + 20  论坛币 + 20  学术水平 + 5  热心指数 + 7  信用等级 + 5   查看全部评分

藤椅
jjjj6666 发表于 2014-3-21 11:55:52
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
        )
)

已有 1 人评分经验 论坛币 热心指数 收起 理由
客初 + 20 + 20 + 2 热心帮助其他会员

总评分: 经验 + 20  论坛币 + 20  热心指数 + 2   查看全部评分

板凳
3qsir 发表于 2014-3-21 14:14:06
Sir :
Can you tell in detail about : " put this in a dos batch file"
means to  open windword 2010 program  then creat a new macro ?
I really don't underrtsnd what is your means?
Sincerly !

报纸
jjjj6666 发表于 2014-3-21 23:19:32
open a notepad, copy them into the notepad, save the notepad into a file named, say, rename.bat, under the folder you have your excel files, and then open a dos command, change to that folder, enter "rename" and hit enter to execute the command.

地板
3qsir 发表于 2014-3-21 23:39:36
You meams is cut rename.bat paste into my excel directlory :C:\test\..xls,
then under MS_DOS (c:\) keyin rename to excute

7
3qsir 发表于 2014-3-22 00:12:46
谢谢您诚心的帮助 !
Have a good time !

8
jjjj6666 发表于 2014-3-22 00:19:13
no problem, thanks!

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-1 12:29