Logging to CSV files
One of the most widely used formats for logging tabular structured information to files is comma-separated values (CSV). Because a CSV file is still a flat text file, CSV is the most popular format for exchanging information between heterogeneous applications.A CSV file is a representation of a rectangular dataset (matrix) containing numeric or string columns. Each row of the matrix is represented by a list of values (one for each column), separated by commas, and should have the same number of values. Sometimes, other value delimiters may be used, such as tab (\t
), colon (:
), and semicolon (;
) characters. The first row might contain the column heads. Usually, a line break, is used as a row delimiter, which is a CRLF (Carriage Return Line Feed) character (usually entered as \r\n
), or simply by LF (\n
) on Unix systems. Thus, an example of the contents of a CSV file might be as follows:
Note that spaces become part of...