如何使用Pharo在给定目录中找到所有以.csv
结尾的文件?
答案 0 :(得分:3)
这也将起作用:
'G:\My Drive\Data Mining' asFileReference allChildrenMatching: '*.csv'
答案 1 :(得分:1)
将basename
和endsWith:
用于目录(FileReference
)的子级。来自http://pharobooks.gforge.inria.fr/PharoByExampleTwo-Eng/latest/FileSystem.pdf:
working := 'G:\My Drive\Data Mining' asFileReference.
working allChildren select: [ :each | each basename endsWith: '.csv' ]