saikoneru1997 / Azure_DataFactory

0 stars 0 forks source link

how to read multiline csv file in databricks #58

Closed saikoneru1997 closed 2 hours ago

saikoneru1997 commented 2 hours ago

Define the file path

file_path = "/path/to/your/multiline_file.csv"

Load the multiline CSV into a DataFrame

df = spark.read.option("header", "true") \ .option("multiLine", "true") \ .option("quote", "\"") \ .option("escape", "\"") \ .option("sep", ",") \ .csv(file_path)

Show the loaded DataFrame

df.show()