How to loop each line in Scala : <p>I am a beginner to Scala and I want to loop through each line which I am reading as below:</p>

<pre><code>val data = sc.textFile("D:/Data.csv")
</code></pre>

<p>Data.csv is like below:</p>

<pre><code>1,462,0,NA,0,1,0,Friday,1,5
1,147,33,NA,0,1,0,Friday,1,5
1,105,58,NA,0,1,0,Friday,1,5
1,276,96,NA,0,1,0,Friday,1,5
1,466,1,NA,0,1,0,Friday,1,5
1,466,1,NA,0,1,0,Friday,1,5
1,466,1,NA,0,1,0,Friday,1,5
</code></pre>

<p>I want to iterate through each line in the above csv and print the 1st and 3 rd column values in each row.Any help is appreciated.</p>
