title: How can I combine multiple lines of text into one line in Python with a delimiter to separate them?
body: <p>I have the following in a text file:</p>
  
  <pre><code>line1
  text1
  text2
  text3
  line2
  something1
  something2
  </code></pre>
  
  <p>I want to create another text file that looks like this:</p>
  
  <pre><code>line1|text1|text2|text3
  line2|something1|something2
  </code></pre>
  
  <p>Whenever a line in the text file says "line" I want to add each line below it to that line with a '|' delimiter.  Can I do this in Python?</p>