CSV does not have a concept of headers. It has rows and columns of values. ANy program processing a CSV file is of course free to treat certain rows or cells in special ways (as if they were headers).
It gets a little more complicated that Jesper described, though. Sometimes the delimiter is not a comma but a semicolon, and if the delimiter occurs inside of a cell, then the cell contents need to be enclosed in double quotes. And if the contents contain double quotes or newline characters, then those need to be escaped.
Before you've coded up all these special cases, you might as well use a ready-made library for reading and writing CSVs. The
AccessingFileFormats FAQ page lists several such libraries.