I am beginner to java. I have a text file. I need to read the line from a text file and splitting its contents and sort them and place the line in the file with the new sorting order.
Lets say my file has the below contents:
900000:Expected Policy# Nopolicy, but found 12345 for the report 'AHQKEHB6-R05'
700020:Expected Policy# Nopolicy, but found 12345 for the report 'AHQKEHB6- R05'
800005:Expected Policy# Nopolicy, but found 12345 for the report 'AHQKEHB6-R05'
900000:Expected Policy# Nopolicy, but found 12345 for the report 'BPTHSRS-R05'
600000:Expected Policy# Nopolicy, but found 12345 for the report 'AHQKEHB6-R05'
Here I need to sort the file in descending based on the first number (eg: 900000) and report.
So the result should be something like:
900000:Expected Policy# Nopolicy, but found 12345 for the report 'BPTHSRS-R05'
900000:Expected Policy# Nopolicy, but found 12345 for the report 'AHQKEHB6-R05'
800005:Expected Policy# Nopolicy, but found 12345 for the report 'AHQKEHB6-R05'
700020:Expected Policy# Nopolicy, but found 12345 for the report 'AHQKEHB6-R05'
600000:Expected Policy# Nopolicy, but found 12345 for the report 'AHQKEHB6-R05'
Please give me an example that helps me. Thanks in advance.