1
$\begingroup$

If we want to see what is contained with a directory we simply go:

FileNames[]

and this will list everything in the current directory. If we want to filter, for example we only want to see .csv files we can then say:

FileNames["*.csv"]

So filtering is fine if one has a key on which to filter, like a file extension or a naming convention.

If I want to only return the folders in a given directory, how would I do this?

$\endgroup$
3

1 Answer 1

2
$\begingroup$

Thanks to the users in the comments:

Select[FileNames[],DirectoryQ]

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.