1

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?

user27119
  • 2,500
  • 13
  • 34

1 Answers1

2

Thanks to the users in the comments:

Select[FileNames[],DirectoryQ]

user27119
  • 2,500
  • 13
  • 34