Although you can think that Comma-Separated Values (CSV) files are simple files where each value is separated by commas, it is far from reality. The most important part of CSV files are delimiters, and one can think that the delimiter, as type name suggests, is comma. But this assumption is not always true and CSV is often applied to files using other delimiters. Typical example is found in countries where comma (,) is used as decimal separator, because you would have no way to discern between decimal number or separator, semicolon (;) is used.
If your application is distributed across different countries and your application should support Comma-Separated Values files, then you should take care about this important fact.
Let's see how can we resolve this problem so we can read CSV files depending on country.
For reading CSV files we are going to use openCSV library. This API contains one class for readingCSV files (CsvReader) and another for writing (CsvWriter). By default it uses comma as column delimiter, but you can also inform which delimiter character must be used.