I would like split to some how split each item in the arry and sort it by Id[1] and then date[2]
Been doing a fair amount of reading and cannot seem to figure this one out.
Name,ID,Date
John,432,2012-03-21 04:32:00 AM
Bob,532,2012-01-01 12:12:00 AM
Mike,932,2012-01-11 11:42:00 AM
Mike,932,2012-05-01 12:13:00 AM
John,1532,2012-01-11 07:32:00 AM
package test;
import java.util.ArrayList;
import java.util.Collections;
public class ArraySort {
public static void main(String args[])
{
ArrayList<String> stringList = new ArrayList<String>();
stringList.add("Bob,532,2012-01-01 12:12:00 AM");
stringList.add("John,432,2012-03-21 04:32:00 AM");
stringList.add("Mike,932,2012-05-01 12:13:00 AM");
stringList.add("John,2532,2012-01-11 11:42:00 AM");
stringList.add("Mike,1532,2012-01-11 07:32:00 AM");
Collections.sort(stringList);
for (int i = 0; i < stringList.size(); i++){
String item = stringList.get(i);
System.out.println(item);
}
}
}