重命名没有括号的多个文件/删除括号窗口 [英] Rename multiple files without parentheses/remove parentheses windows

查看:163
本文介绍了重命名没有括号的多个文件/删除括号窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从任意位置开始以数量递增的顺序重命名大量文件。
但是,当我重命名多个文件时,会留下括号。
例如,我将文件重命名为abc_.jpeg,它导致abc_(1).jpeg,abc_(2).jpeg等。

I want to rename a large number of files in increasing order of numbers, starting from anywhere. But when I rename multiple files, it leaves me with parentheses. eg i rename files to abc_.jpeg it results in abc_(1).jpeg, abc_(2).jpeg and so on.

我尝试使用命令提示符重命名

I tried using command prompt to rename

ren abc _(*)。jpeg abc _ *。jpeg

不起作用。

ren abc_(*).jpeg abc_*.jpeg
doesn't work. probably because of brackets

ren abc _( *)。jpeg abc _ *。jpeg

重命名文件,但产生的文件名与以前相同。
我只是想以某种方式删除括号。

ren abc_"("*")".jpeg abc_*.jpeg
renames the files, but results in the same file name as before. I just want to remove the parentheses somehow.

推荐答案

要删除括号,您将需要进行一些字符串操作。我已经写了一个批处理文件来做到这一点(另存为 .bat

To remove the brackets you will have to do some string manipulation. I have written a batch file to do this (save as .bat)

cd C:\folder
setlocal enabledelayedexpansion
for %%a in (abc_*.jpeg) do (
set f=%%a
set f=!f:^(=!
set f=!f:^)=!
ren "%%a" "!f!"
)

虽然您可能无法在命令行中轻松地在一行中完成此操作,但这可能是可行的,但并不是很漂亮。如果可以的话,请使用此批处理文件删除括号。

I don't think you can easily do this in one line from the command line though, it may be possible but it won't be pretty. If you can help it use this batch file to remove the brackets.

这篇关于重命名没有括号的多个文件/删除括号窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆