批量重命名
一个用于实现文件批量重命名的CLI工具。
安装
-
克隆仓库并将
bin/batch_rename.exe添加到PATHgh repo clone POWRFULCOW89/batch_rename
或者
-
获取pub包
dart pub add batch_rename
并从源代码构建
dart compile exe .\bin\batch_rename.dart
或者
-
获取预编译的二进制文件。
用法
batch-rename.exe substring [new_string] [-h] [-n] [-r]
positional arguments:
substring Substring to strip or replace out of every file in path.
new_string String to replace for every matching substring. Defaults to an empty string.
optional arguments:
-h, --help show this help message and exit.
-n Rename all files to substring and number them accordingly.
-r Batch rename recursively in subdirectories.
示例
-
为
favicon.png生成一套标准图标batch_rename favicon.png
-
为
logo.jpg生成标准、Apple和Windows 10图标集batch_rename logo.jpg -a -w
-
删除所有括号及其内容
batch_rename "\[.+\]"