Sort the output of the command that replaces spaces with colons in the file "file.txt", then cut the first field delimited by the pipe character, and finally sort numerically based on the second field.
sort -nk2 <(cut -d'|' -f1 <(tr ' ' ':' <(cat file.txt)))