val data = spark.read.option("delimiter","\t").option("header","true").csv("hdfs:///ncdc/sample2.txt")

This sample taken from Stackoverflow Question 37638618