How do I parse a comma-delimited (CSV) data file?
Comma-delimited data files can come in several forms, requiring increasing levels of complexity in parsing and handling. They are often referred to as CSV files (for “comma separated values”) and occasionally as SDF files (for “standard data format”). Note that some vendors use “SDF” to refer to variable-length records with comma-separated fields which are “double-quoted” if they contain character values, while other vendors use “SDF” to designate fixed-length records with fixed-length, nonquoted fields! (For help with fixed-length fields, see question 4.23) The term “CSV” became a de-facto standard when Microsoft Excel used it as an optional output file format.