I have n
number of files in a directory with same .txt
extension and I want to load them in a loop and then make separate dataframes
for each of them.
I have read this but in my case all my files have same extension and I want to iterate over them one by one and make dataframe
for every file.
I started by counting files in a directory with following line of code
sc.wholeTextFiles("/path/to/dir/*.txt").count()
but I don't know how should I proceed further? Please guide me.
I am using Spark 2.3
and Scala
.
Thanks.