搜索给定的文件集并复制到另一个目录 [英] search given set of files and copy to another directory

查看:120
本文介绍了搜索给定的文件集并复制到另一个目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在needToFind.txt文件中有一组给定的文件名,例如:

There is a given set of file names in a needToFind.txt file such as:

myImage1.jpg,theImage.jpg,parisImage.jpg

myImage1.jpg , theImage.jpg, parisImage.jpg (This is a flie that I will format it does not matter filee names are seperated with comma, or line break)

并且有一个名为/ MyImageFolder的文件夹,其中包含let说1000个图像,并且还包含myImage1.jpg,theImage.jpg,parisImage.jpg

And there is a folder named /MyImageFolder, which contains lets say 1000 images, and also contains myImage1.jpg , theImage.jpg, parisImage.jpg

我想找到那些给定的图像,并将它们复制到另一个目录。

I want to find those given images and copy them to another directory.

请帮助,这将节省我的人生。

Please help, this will save my life.

感谢

推荐答案

格式needToFind.txt每行一个文件名。以下简单批处理脚本应该可以正常工作。

Format needToFind.txt to have one file name per line. The following simple batch script should work.

@echo off
cd "\MyImageFolder"
for /f "usebackq eol=: delims=" %%F in ("needToFind.txt") do copy "%%~F" "\anotherFolder"

它可以在命令行中没有批处理文件:只需将每个 %% 更改为

It can be done on the command line without a batch file: just change each %% to %.

这篇关于搜索给定的文件集并复制到另一个目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆