使用文件列表复制并移动到 perl 中的新目录
我有一个 txt 文件中的文件名列表。它们与我拥有的 pdf 相关。我想将该列表中列出的实际 pdf 文件复制到目录中。需要复制的文件也包含在不同的子目录中。使用 perl 执行此操作的最简单方法是什么? 谢谢!
I have a list of file names in a txt file. They correlate to pdfs I have. I would like to copy the actual pdf files that are listed in that list, to a directory. The files that need to be copied are contained in different subdirectories as well. What is the easiest way to do this using perl?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我建议您阅读 perlfaq5: How do我复制文件?
之后,应该不会太难;未经测试的代码:
I'd recommend that you read perlfaq5: How do I copy a file?
After that, it shouldn't be too hard; Untested code:
我建议您使用 perl File::Copy 包。
I would recommend that you use the perl File::Copy package.