title: MATLAB / Octave - how to parse CSV file with numbers and strings that contain commas
body: <p>I have a CSV file that has 20 columns. Some of the columns have number values, others have text values, and the text ones may or may not contain commas.</p>
  
  <p>CSV content example:</p>
  
  <pre><code>column1, column2, column3, column4
  "text value 1", 123, "text, with a comma", 25
  "another, comma", 456, "other text", 78
  </code></pre>
  
  <p>I'm using <code>textscan</code> function, but I'm getting the most buggy and weird behavior. With some arguments, it reads all the values in only one column, sometimgs it repeats columns, and most of the things I've tried lead to the commas being incorrectly interpreted as column separators (despite text being enclosed in double quotes). That is, I've tried specifying 'delimiter' argument, and also including literals in the format specification, to no avail.</p>
  
  <p>What's the correct way of invoking <code>textscan</code> to deal with a CSV file as the example above? I'm looking for a solution that runs both on MATLAB and on Octave (or, if that's not possible, the equivalent solution in each one).</p>