INPUT: b|2013.06.03. 18:47|a|2013.06.03. 13:15|c|2013.06.03. 13:53|needed OUTPUT:a|2013.06.03. 13:15|c|2013.06.03. 13:53|b|2013.06.03. 18:47|How can I sort the dates correctly in ascendant order? The delimiter is the |. P.S.sort -t | -n -k 2is not enough, because it doesn't put the HH:MM in good order, only the YYYY.MM.DD.
How to sort date: YYYY.MM.DD. HH:MM?
sort
Try:sort -t |  -k 2By leaving out the -n, you sort on the whole string between '|' characters not just the first number that can be made out of that string (2013).