Wednesday, March 31, 2010

There's a way to do that in emacs

Given a number of lines of text such as

foopy charlie
foo bravo
food alpha

and you want to sort them by their second field so they end up like

food alpha
foo bravo
foopy charlie

the right emacs incantation is:

C-u 2 M-x sort-fields

That's all.

1 comment: