Forum Discussion
jonjoseph
2 years agoRegular Visitor
Fabric Notebook how do I loop files in a folder?
Hi, So complete newbie to the cloud coming from on premise MS stack. Trying to put together a PoC end to end. I have created a lakehouse. So far I have dumped data from an external system to csv ...
- 2 years ago
Copy file API path with os.listdir worked!
smpa01
Community Champion
2 years agojonjoseph if I understood correctly, you have this
Grab the ABFS path and utilize in the notebook
// Replace this with your actual folder path
val files = "abfss://[email protected]/testLH2.Lakehouse/Files/DailyFiles"
// Read each CSV file in the folder
val df = spark.read.option("header", "true").csv(files)
.select("*", "_metadata.file_name","_metadata.file_modification_time")
display(df)