Logging to CSV files
One of the most widely used formats for logging tabular structured information to files is comma-separated values (CSV). Since 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 a comma, and should have the same number of values. Sometimes, other value delimiters could be used, such as tab (\t
), colon (:
), and semi-colon (;
) characters. The first row could contain the column header names. Usually, a line break, made by CRLF (Carriage Return Line Feed) characters (usually entered as \r\n
), or simply by LF (\n
) in Unix systems, is used as a row delimiter. So, an example of CSV file content could be the following:
Note...