This content has been marked as final. Show 4 replies
EJP wrote:Even when that makes a whole lot of sense it didn't even pass my mind to suggest that...
Indeed. If it is really 'large' by any commonly understood measure, you should certainly be using a database for this task
using a H2 or HSQL database you can even solve it without needing any DBMS being installed and running.
If the inputs are small enough that you could hold them in memory, one solution is be simply to read each line into a list, then sort the list with a comparator that compares only the content of the specified column.
But, as the other posters note, if the lists are large (your definition of "large" may vary from mine), then a database may be the way to go.