cmd - 在 CMD 中重命名多个文件名
问题描述
我的每个文件都有我想替换的同一个月。
问题是月份在中间和空格之后。它看起来像这样apple Oct'18.xlsx
基于此网站, https://superuser.com/questions/475874/how-does-the-windows-rename-command-interpret-wildcards
我试着用ren ??????Oct???*.xlsx ??????Nov???*.xlsx
解决方案
使用 PowerShell 作为-replace
操作员的工具非常容易
Powershell -NoP -C "Dir '* Oct*.xlsx'|Ren -NewName {$_.Name -Replace ' Oct',' Nov'}
样本输出贷款 aschipfl 的模板
and some pears Nov'18_xyz.xlsx
apples Nov'18.xlsx
bananas Nov'18.xlsx
more fruit Nov'18_xyz.xlsx
oranges Oct'18.xls2x
plus peaches Nov'18_xyz.xlsx
strawberries Nov'18 abc.xlsx
推荐阅读
- kubernetes - 将 pod 中的 Mongodb 连接到 kubernetes 中的另一个 nestjs api pod
- java - 方法 thenReturn(Future
) 在 OngoingStubbing 类型中 > 不适用于参数(字符串) - c - 在 switch case 语句中声明变量
- linux - 如何使用 awk 命令行打印列并添加标题
- javascript - vue filtersearch对象数组内的对象数组
- python-3.x - 使用 Python 将 csv 格式的数据转换为类似 xml 的格式
- laravel - Laravel 8 消失按钮
- python - 在文件中写入长字符串
- angular - 未生成 D3 v5 面积图
- python - 如何使用来自纳斯达克的自动 Python 脚本下载最新的数据集(.csv)?