title: To add a new line before a set of characters in a line using python
body: <p>I have a line of huge characters in which a set of characters keep repeating. The line is : <code>qwethisistheimportantpartqwethisisthesecondimportantpart</code> </p>
  
  <p>There are no spaces in the string. I want to add a new line before the string 'qwe' so that I can distinguish every important part from the other.</p>
  
  <p>Output : </p>
  
  <pre><code>qwethisistheimportantpart
  qwethisisthesecondimportantpart
  </code></pre>
  
  <p>I tried using </p>
  
  <pre><code>for line in infile:
      if line.startswith("qwe"):
          line="\n" + line
  </code></pre>
  
  <p>and it doesn't seem to work</p>