I am a beginner in batch scripting, trying to sort a text file and get the highest date in a year. Tried different options to sort text file based on date and remove duplicate lines, and finally get the highest period for each year into a different text file. But at first step, I am not able to sort by date in the text file. Please see below example.
Example: In file1, I have below lines
May-2017
Jul-2017
May-2017
Jan-2017
Sep-2018
Feb-2018
Output in file2 should be
Jul-2017
Sep-2018