I am building a generic tool in Java which reads data from a CSV and assigns it to some variables in the code and does bunch of stuff with it. I just realised that I should use an existing library (like SuperCSV) than doing it on my own. Now my question is the following: Since this is a generic tool, the datatypes of the values are not known. It depends what is present in the CSVfile. Now the user who would be building the CSV would know the datatypes. So I could add a "datatype" column in the CSV and the user could write "int" or "float" or "String" there. And then I could use if/then clauses in the code to assign the right datatype. But I am not sure if that is the most apt approach. Any thoughts? (I dont post on StackOverflow often so please advise if I am not being clear or detailed enough. Thanks!)
regards Anupam