title: how to read CSV file in scala
body: <p>I have a CSV file and I want to read that file and store it in case class. As I know A CSV is a comma separated values file. But in case of my csv file there are some data which have already comma itself. and it creates new column for every comma. So the problem how to split data from that.</p>
  <p>1st data</p>
  <pre><code>04/20/2021 16:20(1st column)    Here a bunch of basic techniques that suit most businesses, and easy-to-follow steps that can help you create a strategy for your social media marketing goals.(2nd column)
  </code></pre>
  <p>2nd data</p>
  <pre><code>11-07-2021 12:15(1st column)    Focus on attracting real followers who are genuinely interested in your content, and make the most of your social media marketing efforts.(2nd column)
  </code></pre>
  <pre><code>var i=0
  var length=0
  val data=Source.fromFile(file)
  for (line &lt;- data.getLines) {
    val cols = line.split(&quot;,&quot;).map(_.trim)
    length = cols.length  
    while(i&lt;length){
      //println(cols(i))
      i=i+1
    }
    i=0
  }
  </code></pre>