Scala : Print List of List into a file : each nested list is a new line
<p>Pretty New to Scala.
Trying this</p>

<pre><code>val ListNew=List(List("this", "is", "it?"), List("yeah", "what", "else", "do","you","expect"))
</code></pre>

<p>into a File / Screen , like this:</p>

<pre><code>this is it? \n
yeah what else do you expect
</code></pre>

<p>I did manage it with the following code</p>

<pre><code>var ctr =0 ;
ListNew.map(k=&gt;  for(rec &lt;-k  ) {ctr=ctr+1 ;if (ctr == k.length){print(rec +"\n " );ctr =0; } else {print(rec+" ")}  })
</code></pre>

<p>But I dont want counters : Is there a way to get a print "\n" before two <strong>foreach</strong> .I tried Iterators , could not get them right</p>