title: splitting string and adding the output string and creating a hashmap out of it in scala
body: <p>I have a csv file with two columns like this:</p>
  
  <pre><code>column1                             column2
  sachin@@@tendulkar@@@Ganguly       cricket@@@India@@@players
  </code></pre>
  
  <p>I want to convert it to a hash map which would be like this:</p>
  
  <pre><code>sachin-&gt; "cricket, India, players"
  tendulkar-&gt; "cricket, India, players"
  Ganguly-&gt; "cricket, India, players"
  </code></pre>
  
  <p>cricket, India, players this should be a one string. How can I get it done in scala?
  This is what I have done so far</p>
  
  <pre><code>val csv = sc.textFile("/tag/players.csv")  
  val headerAndRows = csv.map(line =&gt; line.split(",").map(_.trim))
  val header = headerAndRows.first()  
  val synonyms = csv.map(_.split(",")).map( p=&gt;(p(1))  // for column1
  val targettag = csv.map(_.split(",")).map(p=&gt;p(2))   // for column2
  val splitsyno = synonyms.map(x =&gt; x.split("@@@"))
  val splittarget = targettag.map(x=&gt;x.split("@@@"))
  </code></pre>
  
  <p>I want to know how to proceed forward to create the desired hashmap?</p>