Sorting a text file by date - Date looks like DD/MM/YYYY
- by John N
I am trying to sort the dates from the earliest to the latest.
I was thinking about using the bufferedreader and do a try searching the first 2 characters of the string and then the 4th and 5th characters and finally the 7th and 8th characters, ignoring the slashes.
The following is an example of the text file I have:
04/24/2010 - 2000.0 (Deposit)
09/05/2010 - 20.0 (Fees)
02/30/2007 - 600.0 (Deposit)
06/15/2009 - 200.0 (Fees)
08/23/2010 - 300.0 (Deposit)
06/05/2006 - 500.0 (Fees)