I have a scenario where I have below data in file which need to be sorted based on date column , first line is the headers it should not be sorted
NAME|AGE|COURSE|DATES
v1|31|MC|12 JUL 2019
v2|33|MB|4 JUL 2019
v3|12|GG|13 JUL 2019
v4|21|JJ|7 JUL 2019
My code :
sort -n -k k4 /d/file.txt
This above code does not sort my data
Expected Output :
NAME|AGE|COURSE|DATES
v4|21|JJ|7 JUL 2019
v2|33|MB|4 JUL 2019
v1|31|MC|12 JUL 2019
v3|12|GG|13 JUL 2019