0

I've a directory(/home/linus/data/) and having multiple files of different extensions.

Want to collect all file names only which are having extension .pat and store in Dataset.

How can I achieve it ?

linus jame
  • 31
  • 4
  • 3
    just read it with regex, example: spark.read.text("*.pat") it should work. – ShemTov Jul 21 '20 at 17:41
  • Does this answer your question? [How to read all files in a folder from Java?](https://stackoverflow.com/questions/1844688/how-to-read-all-files-in-a-folder-from-java) – above_c_level Jul 21 '20 at 17:50
  • @ShemTov, dont want to read content of file, but just file names only. Will it work ? – linus jame Jul 21 '20 at 19:22

0 Answers0