0
votes

How can I look at the contents (first few lines at least) of a CSV file stored in Data Lake from Azure Databricks notebook using the %fs commands.

1
Hi @learner, If my answer is helpful for you, you can accept it as answer( click on the check mark beside the answer to toggle it from greyed out to filled in.). This can be beneficial to other community members. Thank you.CHEEKATLAPRADEEP-MSFT

1 Answers

2
votes

To list the contents of a CSV file from Azure Gen2 storage in Azure Databricks notebook, you can use "dbutils.fs.head" command.

Example: dbutils.fs.head("dbfs:/mnt/mountname/filename.csv")

dbutils.fs.head("dbfs:/mnt/chepra/drivers.csv")

enter image description here