ITPub博客

首页 > 数据库 > Oracle > 批量修改扩展名

批量修改扩展名

原创 Oracle 作者:hai503 时间:2023-01-31 16:13:15 0 删除 编辑

很多图书配备的源码都是txt格式,以前示例直接修改为SQL文件,方便编辑器直接打开


tree /f
ren *.txt *.sql
for /R %x in (*.txt) do ren "%x" *.sql



参考:

  • Recursively batch rename file extensions

The following command will  rename files from one extension to another, in all subfolders:

forfiles /S /M *.ext1 /C "cmd /c rename @file @fname.ext2"

or

FOR /R %f IN (*.kar) DO REN "%f" *.mid

For example, if you want to rename all jpg files to png files, the command would be as below:

forfiles /S /M *.jpg /C "cmd /c rename @file @fname.png"


---

@ECHO OFF
PUSHD .
FOR /R %%d IN (.) DO (
cd "%%d"
IF EXIST *.old-extension (
REN *.old-extension *.new-extension
)
)
POPD


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/12707874/viewspace-2933444/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: DBeaver 设置
请登录后发表评论 登录
全部评论

注册时间:2012-09-04

  • 博文量
    79
  • 访问量
    222940