title: Replace every third comma with line break
body: <p>I have some data of the following format:</p>
  
  <pre><code>var =  1,2,3,4,5,6,7,8,9
  </code></pre>
  
  <p>If I use the following code:</p>
  
  <pre><code>var = var.replace(',', '\n')
  print var
  </code></pre>
  
  <p>I get an output like this:</p>
  
  <pre><code>1
  2
  3
  4
  5
  6
  7
  8
  9
  </code></pre>
  
  <p>What I want to get though is an output like this:</p>
  
  <pre><code>123
  456
  789
  </code></pre>
  
  <p>Which would involve only replacing every third comma with a line break. Is there a way to do this? I'ver had a look at some of the other questions on here and they don't seem to be addressing exactly what I am trying to do.</p>
  
  <p>Thanks</p>