title: How to read a fixed length file in Spark using DataFrame API and SCALA
body: <p>I have a fixed length file ( a sample is shown below) and I want to read this file using DataFrames API in Spark using SCALA(not python or java).
  Using DataFrames API there are ways to read textFile, json file and so on but not sure if there is a way to read a fixed-length file. I was searching the internet for this and found a github <a href="https://github.com/quartethealth/spark-fixedwidth" rel="nofollow">link</a>, but I got to download <code>spark-fixedwidth-assembly-1.0.jar</code> for this purpose however I was unable to figure out the jar anywhere. I am completely lost here and need your suggestions and help. There are couple of posts in Stackoverflow but they are not relevant to Scala and DataFrame API.</p>
  
  <p>Here is the file</p>
  
  <pre><code>56 apple     TRUE 0.56
  45 pear      FALSE1.34
  34 raspberry TRUE 2.43
  34 plum      TRUE 1.31
  53 cherry    TRUE 1.4 
  23 orange    FALSE2.34
  56 persimmon FALSE23.2
  </code></pre>
  
  <p>The fixed width of each columns are 3, 10, 5, 4</p>
  
  <p>Please suggest your opinion.</p>