My file has one book listed per line, title first followed by a tab character, followed by the author's name.
TITLE<TAB>AUTHOR
TITLE<TAB>AUTHOR
...
I want to swap the two fields, such that the author's name appears first on each line.
AUTHOR<TAB>TITLE
AUTHOR<TAB>TITLE
...
I could accomplish this with a keyboard macro, but it seems like the sort of thing which might come up again. It seems to me that Emacs Lisp should be able to do the job, but how to go about it? What if next time I want to delete a field, or filter lines based on specific fields?
In fact, AWK excels at exactly these kinds of tasks. What about Emacs Lisp?
EDIT: To reiterate, I'd like to do this with elisp, rather than evil
, org
, or other features.