我在Windows中有一堆文件有前缀和后缀需要删除。你知道吗
例如
[video] Home Video - 014 Sunday Night[480p] [x265] [robert].mkv
[video] Home Video - 015 Monday Night[480p] [x265] [robert].mkv
[video] Home Video - 016 Tuesday Night[480p] [x265] [robert].mkv
我想重命名这些文件,这样它会说
014 Sunday Night
015 Monday Night
016 Tuesday Night
我不介意使用PowerShell、Python、Bat或者Windows提供的任何东西。 我宁愿不下载第三方工具,但会考虑它,如果需要的话
您可以使用单个PowerShell cmdlet:
您可以在python中读取带有“os”的文件,并用常规表达式替换名称:
读取文件:https://www.tutorialspoint.com/python/os_rename.htm
用python重命名文件:Rename multiple files in a directory in Python
使用regex删除文本:How to remove symbols from a string with Python?
相关问题 更多 >
编程相关推荐