title: Convert text file to sequence array format in Spark Scala
body: <h2>i have sample.txt:</h2>
  
  <pre><code>1 2 3
  1 3 2 1 2
  1 2 5
  6
  </code></pre>
  
  <p>how to convert this to become sequence array same as</p>
  
  <pre><code>(Seq( Array(Array(1), Array(2), Array(3)),
        Array(Array(1), Array(3), Array(2), Array(1), Array(2)),
        Array(Array(1), Array(2), Array(5)),
        Array(Array(6) )
  </code></pre>
  
  <p>i want to try using text file for prefixSpan mllib Spark, <a href="http://spark.apache.org/docs/latest/mllib-frequent-pattern-mining.html" rel="nofollow">check this</a></p>