Although comments are not part of the CSV standard (per RFC 4180),
many applications make use of comments in CSV files to provide additional information or to add context to the data.
A simple example of a CSV file with comments is shown below:
A more complex example of a CSV file with comments is shown below.
It shows how comments could be misinterpreted as part of a field if not handled correctly:
Reading CSV files with comments
When reading comments, FastCSV provides flexibility in how comments are handled.
You may ignore comments entirely by treating them as part of the data, skip them, or read and interpret them as comments.
More information about the CommentStrategy enum can be found in the corresponding
JavaDoc.
By default, FastCSV treats comments as part of the data to ensure that no data is lost and to maintain
maximum compatibility with the RFC 4180 standard.