I have tried the below pyspark code to read the header and trailer records from fixed length file:
path = "/axx/yy/test" rdd = spark.read.text(path)