Databricks pyspark - Find columns in xls file.

weldermartins
Honored Contributor

Hello everyone, every day I extract data into xls files but the column position changes every day. Is there any way to find these columns within the file?

Here's a snippet of my code.

df = spark.read.format("com.crealytics.spark.excel")\
  .option("header", "true")\
  .schema(schema)\
  .option("dataAddress", "'releases'!A27:D78") \
  .load("dbfs:/FileStore/tables/invoice_september.xls")
df.display()