title: process RDD based on condition in SPARK scala
body: <p>i am extracting a column of a csv file that might contain empty value. So, I need to convert those empty value to 0 first, before calling toInt? </p>
  
  <pre><code>val field= sc.textFile("test.txt").map(_.split(",")(8))
  </code></pre>
  
  <p>how would i go about accomplishing this?</p>
  
  <p>sample data is as follow:</p>
  
  <pre><code>3070811,1963,1096,,"US","CA",,1,
  3022811,1963,1096,,"US","CA",,1,56
  3033811,1963,1096,,"US","CA",,1,23
  </code></pre>