Sort errors by line number and display number of errors