批处理脚本复制小写文件
我有文件正在上传到文件夹。我需要一个批处理脚本来根据文件名将这些文件重定向到单独的文件夹。除了两组文件名称非常相似但大小写不同之外,这一切都很好。 IE。 log0000.txt 和 LOG0000.txt。
我想做的是搜索文件夹并检查所有文件,如果它们有小写“log”,则将它们移动到一个文件夹,如果它们有大写“LOG”,则将它们移动到另一个文件夹。
我知道如何循环遍历文件夹中的文件,但我不确定如何匹配比较并根据大小写匹配每个文件。
谢谢。
I have files being uploaded to a folder. I need a batch script to redirect those files to separate folders based on filenames. That's all fine except for two sets of files that have very similar names but only different by case. Ie. log0000.txt and LOG0000.txt.
What I would like to do is search through the folder and check all files and if they have a lowercase "log", move them to one folder and if they have uppercase "LOG", move them to the other.
I know how to loop through the files in the folder, but I'm unsure how to match the comparision and match each file based on case.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
既然您已经知道如何循环和移动,
Since you already know how to loop and move,