You can use awk script to create a file that left lines at a fixed length, sort the resulting file, and split leading spaces into result.
Some time has passed since I used awk, but, as I recall, it was not difficult to get everything right justified.
source
share