Why did you respond to my post with a private message instead of just posting your question here?
I have finished reading the file and split the contents(i.e the string and the number).
From here i have to sort the contents.
The problem comes when am trying to read the date and to print it in the format specified in the output file.
Please explain exactly what "the problem" is. Did you write some code? Does it compile or not? Do you get an error message? If yes, copy & paste the error message here.
You can parse and format dates using java.text.SimpleDateFormat (see the API documentation).