title: parse txt with different types in string
body: <p>I have txt files with semistructured data, I have to write it in cassandra through spark-cassandra. But for the first I what to parse in only in scala.</p>
  
  <p>my code :</p>
  
  <pre><code>import java.io.File
  import scala.io.Source
  
  object parser extends App {
    val path = "somepath"
    val fileArray = (new java.io.File(path)).listFiles()
     for (file &lt;- fileArray)
      for (line &lt;- Source.fromFile(file).getLines())
  </code></pre>
  
  <p>So how can I parse each string and get values to put it in cassandra?
  for example I have (int, text, timestamp, int, text, char, int, text)?
  I have to split line for delimiter(" ")? and put them in a tuple? or each of them to convert to readable format?</p>