title: Is it possible to handle fields containing line breaks in awk?
body: <p>Suppose I have a text file with records of the following form, where the <code>FS</code> is generally speaking a comma, and the <code>RS</code> is generally speaking a newline.</p>
  
  <p>However, the exception to this rule is that if a field is in quotes, it should treat the line breaks and commas as part of the field.</p>
  
  <pre><code>"This field contains
  line breaks and is
  quoted but it 
  should be treated as a 
  single field",1,2,3,"another field"
  </code></pre>
  
  <p><strong>How can I use awk to parse such a file correctly, where I can still access <code>$1,$2...</code>, as I usually would, but with the above interpretation of fields?</strong></p>
  
  <p>I have already looked at <a href="http://wiki.bash-hackers.org/snipplets/awkcsv" rel="nofollow">this wiki page</a>, but the solution presented there does not solve the problem of line breaks.</p>