 <p>You say you're outputting a csv. Are you sure your data fields have no commas in them? That can manifest as "extra" columns when you read the csv file. Or does your "NAME" field have single-quotes and commas in it that might break your explicit double-quoting?</p> <p>Look at the records with "extra" fields in them &amp; trace back to your source data. The first spurious value will tell you where the breakage is.</p>