查找与模式匹配的所有文件名 [英] Find all file names that match a pattern

查看:35
本文介绍了查找与模式匹配的所有文件名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试找到一种方法来列出与此模式匹配的文件夹中的所有文件名:

I am trying to find a way to list all file names in a folder that matches this pattern :

20131106XXXXX.pdf 

前缀是日期,XXXX的内容和长度因文件而异,我只关心pdf文件.

The prefix is the date, and the content and length of XXXX vary across files, and I only care about pdf files.

任何人都可以建议一种方法来做到这一点?

Anyone could advise a way to do this?

推荐答案

试试这个

list.files(path="./yourdir",pattern="[[:digit:]]{8}.*\\.pdf") 

这篇关于查找与模式匹配的所有文件名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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