# Sort bibtex fields in bib file

**URL:** <https://discourse.jabref.org/t/sort-bibtex-fields-in-bib-file/1734>\
**Category:** Help\
**Created:** [August 30, 2019, 7:58am UTC](https://discourse.jabref.org/t/sort-bibtex-fields-in-bib-file/1734 "2019-08-30T07:58:15Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rockerilla77](https://avatars.discourse-cdn.com/v4/letter/r/59ef9b/32.png) [@Rockerilla77](https://discourse.jabref.org/u/Rockerilla77)\
**Post date:** [August 30, 2019, 7:58am UTC](https://discourse.jabref.org/t/sort-bibtex-fields-in-bib-file/1734/1 "2019-08-30T07:58:15Z")

</div>

Dear All

my bib file is getting messy. I sorted out most problems using the cleaning functionality of JabRef, but there is still one thing.

Sometimes I get bib records from publishers website or other colleagues collaborating on paper, the fact is that there is not a precise order in the bib fields. Some of them are not particularly problematic, but often I have “author = {…}” in the middle, or “title = {…}” in the end of the records. This is annoying when I need to to put my hands on the bib source file.

There is any way to save the bib file so that filelds are listed in a particular order?

Thanks for your help  
Pietro

---

<div class="post-metadata">

**Author:** ![mlep](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/mlep/32/387_2.png) [@mlep](https://discourse.jabref.org/u/mlep)\
**Post date:** [August 30, 2019, 8:54am UTC](https://discourse.jabref.org/t/sort-bibtex-fields-in-bib-file/1734/2 "2019-08-30T08:54:18Z")

</div>

In the preferences menu, under File, you have an option “Always reformat BIB file on save and export”. Is it checked?  
Additionally, in File -\> Database properties, you can set the order of the entries.

---

<div class="post-metadata">

**Author:** ![Rockerilla77](https://avatars.discourse-cdn.com/v4/letter/r/59ef9b/32.png) [@Rockerilla77](https://discourse.jabref.org/u/Rockerilla77)\
**Post date:** [August 30, 2019, 9:32am UTC](https://discourse.jabref.org/t/sort-bibtex-fields-in-bib-file/1734/3 "2019-08-30T09:32:19Z")

</div>

Dear mlep

yes in Options \> Preferences \> File the option “Always reformat BIB file on save and export” is checked

However can’t see “Database properties” in File.

I’m working with JabRef 4.3, the last version doesn’t work on my Linux distro

---

<div class="post-metadata">

**Author:** ![Siedlerchr](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/siedlerchr/32/216_2.png) [@Siedlerchr](https://discourse.jabref.org/u/Siedlerchr)\
**Post date:** [September 7, 2019, 1:50pm UTC](https://discourse.jabref.org/t/sort-bibtex-fields-in-bib-file/1734/4 "2019-09-07T13:50:37Z")

</div>

Database properties have been renamed to library properties

---

<div class="post-metadata">

**Author:** ![Rockerilla77](https://avatars.discourse-cdn.com/v4/letter/r/59ef9b/32.png) [@Rockerilla77](https://discourse.jabref.org/u/Rockerilla77)\
**Post date:** [September 8, 2019, 7:14am UTC](https://discourse.jabref.org/t/sort-bibtex-fields-in-bib-file/1734/5 "2019-09-08T07:14:48Z")

</div>

ok thanks for this

however under FILE\>LIBRARY PROPERTIES I can’t see anything that can sort the the entry fields

---

<div class="post-metadata">

**Author:** ![mlep](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/mlep/32/387_2.png) [@mlep](https://discourse.jabref.org/u/mlep)\
**Post date:** [September 11, 2019, 9:35pm UTC](https://discourse.jabref.org/t/sort-bibtex-fields-in-bib-file/1734/6 "2019-09-11T21:35:07Z")

</div>

Indeed, in the Library properties, only the order of the entries can be changed…  
But using JabRef 4.3.1 and checking “Always reformat BIB file on save and export” did sort the fields on my library.

---

<div class="post-metadata">

**Author:** ![Rockerilla77](https://avatars.discourse-cdn.com/v4/letter/r/59ef9b/32.png) [@Rockerilla77](https://discourse.jabref.org/u/Rockerilla77)\
**Post date:** [September 14, 2019, 8:29am UTC](https://discourse.jabref.org/t/sort-bibtex-fields-in-bib-file/1734/7 "2019-09-14T08:29:04Z")

</div>

I tried with 4.3.1 but still it doesn’t work.

---

<div class="post-metadata">

**Author:** ![Siedlerchr](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/siedlerchr/32/216_2.png) [@Siedlerchr](https://discourse.jabref.org/u/Siedlerchr)\
**Post date:** [September 14, 2019, 9:09pm UTC](https://discourse.jabref.org/t/sort-bibtex-fields-in-bib-file/1734/8 "2019-09-14T21:09:50Z")

</div>

Have you tried the export option, e.g. export to a new bib file with the specified save/sort order?

---

<div class="post-metadata">

**Author:** ![Rockerilla77](https://avatars.discourse-cdn.com/v4/letter/r/59ef9b/32.png) [@Rockerilla77](https://discourse.jabref.org/u/Rockerilla77)\
**Post date:** [September 16, 2019, 12:42pm UTC](https://discourse.jabref.org/t/sort-bibtex-fields-in-bib-file/1734/9 "2019-09-16T12:42:40Z")

</div>

this worked  
Thanks  
P
