Hey guys and gals,
Having an issue here that I thought would be simple enough, but it turns out I'm rustier than I thought. I need to import a a text file into a Java program with multiple records (e.g. name, ID, age) and I want to sort those records in ascending order by ID number. So I'd somehow have to set a "key" stating to sort by that, but keep all the other information associated with that ID number when it's sorted. Any ideas on how to format the text file (001, John, 23; 002, Mary, 47... or however, that was just a guess) and let the Java program know that the ID number is the one to sort by? Drawing a blank here!
Thanks,
Matt
Having an issue here that I thought would be simple enough, but it turns out I'm rustier than I thought. I need to import a a text file into a Java program with multiple records (e.g. name, ID, age) and I want to sort those records in ascending order by ID number. So I'd somehow have to set a "key" stating to sort by that, but keep all the other information associated with that ID number when it's sorted. Any ideas on how to format the text file (001, John, 23; 002, Mary, 47... or however, that was just a guess) and let the Java program know that the ID number is the one to sort by? Drawing a blank here!
Thanks,
Matt