title: Cannot delimit a record using \n as some values in the field has \n chars
body: <p>I am trying to read a file in python which has some records like this:</p>
  
  <pre><code>This|is|a|si
  ngle|reco
  rd|
  </code></pre>
  
  <p>The entire text is a single record but the values 'single' and 'record' have \n in it because of which my record delimiter (which is set to \n) is messing up records like this.</p>
  
  <p>My field delimiter is |, and I want these records to be read like as shown below.</p>
  
  <pre><code>This|is|a|single|record|
  </code></pre>
  
  <p>I have tried the below:
  with open(infile, 'Ur') as origin:
          for line in origin:
              tempDest.write(line.strip('\n'))</p>
  
  <p>The problem with this is, it messes up the lines above and below the record we are trying to fix.
  For example:</p>
  
  <p>OK|RECORD|
  This|is|a|si
  ngle|reco
  rd|
  OK|RECORD2|</p>
  
  <p>looks like this:
  OK|RECORD|This|is|a|single|record|OK|RECORD2|</p>
  
  <p><img src="https://i.stack.imgur.com/kJaaV.png"></p>