vim

sort pipe delim table

!sort -k3 -t'|'

insert the name of current file

In insert mode, type ctrl-R then % to insert the name of the current file.