I have some
.bib files whose formatting is kind of messy: spacing, upper/lowercase use, order within and among entries... ugh. Is there a simple command-line utility which could arrange it neatly for me in a uniform format?
Option 1: With Emacs (in BibTeX mode), placing the cursor at the beginning of an entry and pressing
C-v C-Q does
bibtex-fill-entry, that can be customized in various ways.
Option 2: Biber has reformatting capabilities:
biber --tool --output_align --output_indent=2 --output_fieldcase=lower <filename>.bib
<filename>_bibertool.bib with similar effects; I've shown some of the possible options. Biber is not limited to reformatting; fields can be removed and other changes are possible, see the manual.
There are some BibTex utilities on CTAN:
The following two sound like they will do exactly what you asked for: