learner
learner

Reputation: 1023

How can I list the contents of a CSV file from Azure Gen2 storage in Azure Databricks notebook?

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.

Upvotes: 0

Views: 307

Answers (1)

CHEEKATLAPRADEEP
CHEEKATLAPRADEEP

Reputation: 12788

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

Upvotes: 2

Related Questions