title: Parsing CSV file with multiline fields and escaped double quotes
body: <p>What is the best way to parse a CSV file with <strong>multiline fields and escaped quotes</strong>?</p>
  
  <p>For example, this CSV</p>
  
  <pre><code>First field of first row,"This field is multiline
  
  but that's OK because it's enclosed in double qoutes, and this
  is an escaped "" double qoute" but this one "" is not
     "This is second field of second row, but it is not multiline
  because it doesn't start 
  with an immediate double quote"
  </code></pre>
  
  <p>looks in Excel like this:</p>
  
  <p><img src="https://i.stack.imgur.com/teluj.png" alt="enter image description here"></p>
  
  <p>Do I just preserve the state somehow, have a flag saying if the field I'm reading now has started with a qoute, etc.? Also, what happens to cases where there are double quotes but not at the start of the field, i.e. <code>,   "ABC"</code>, or <code>,"item "" item" ""</code> are those considered invalid? Also, are <code>""</code> quotes escaped if not inside a quoted field? Excel doesn't seem to.</p>
  
  <p>Are there any other <strong>corner cases</strong> I might have missed?</p>