I have several CSV files and I need to load them and search for rows by column value.
Someone suggests to use OpenCSV project to load CSV. But I don’t know if this is the best way.
Does OpenCSV provide some search/filter utility?
Is there a better way to do what I need?
If your CSV files are too big to keep in memory and you don’t want to resort to storing everything in a database first (this would be a tedious disk to memory to disk operation) then there is another approach nobody seems to have mentioned: streaming.
The approach would consist of reading a number of rows from the file, processing them and then discarding the ones that don’t match your search. You could do this with the Apache commons FileUtils for example. It could be some of the existing CSV API’s offer this, I haven’t checked that.