VSCODE批处理重命名文件使用解析文件名
我有一个文件夹的“日期+索引”'PDF文件,我需要重新订购日期格式。 当前格式ddmmyyy_index.pdf。示例:01012006_1.pdf。 我希望格式为yyyy_mm_mm_dd-index.pdf。结果示例2006_01_01-1.pdf。 第一个障碍是将文件名解析并重新订购。可选的任务是占用“ 0”开头的所有几个月和几天,以删除“ 0”,因此最终结果将是2006_1_1_1-1.pdf。
我想使用VSCODE来执行此操作,但是任何常见的脚本类型都是可以接受的。
I have a folder of ''date+index'' pdf files that I need to re-order the date format.
Current format ddmmyyyy_index.pdf. Example: 01012006_1.pdf.
I want the format to be yyyy_mm_dd-index.pdf. Result example 2006_01_01-1.pdf.
The first hurdle is getting the file name parsed and re-ordered. The optional task is to take all months and days that begin with '0' to drop the '0', so the final result would be 2006_1_1-1.pdf.
I would like to use vscode to do this, but any common script type is acceptable.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定使用VS代码重新排序日期格式是什么意思;但是,您可以使用TypeScript进行:
I am not sure what you mean by using VS Code to re-order the date format; however, you can use TypeScript to do so: