title: Converting Strings into Excel Friendly Format
body: <p>I have a string of text. The string has multiple newline characters in it. I want to create a csv that includes this string so I can import it into excel. However because of this I believe I have to convert all the new lines to carriage returns and wrap the text in quotes.</p>
  
  <p>However when trying to convert a small amount of text I get the follow results:</p>
  
  <p><strong>Before</strong></p>
  
  <pre><code>&gt;&gt;&gt; abc = "\nA\nB\nC\nD\nE\nF\nG\n\n"
  &gt;&gt;&gt; print abc
  
  A
  B
  C
  D
  E
  F
  G
  </code></pre>
  
  <p><strong>After</strong></p>
  
  <pre><code>&gt;&gt;&gt; xyz = abc.replace('\n','\r')
  &gt;&gt;&gt; xyz
  '\rA\rB\rC\rD\rE\rF\rG\r\r'
  &gt;&gt;&gt; print xyz
  G
  </code></pre>
  
  <p>Any ideas what I am doing wrong ?</p>