# How to avoid adding unnecessary whitespaces while saving files

**URL:** <https://discourse.jabref.org/t/how-to-avoid-adding-unnecessary-whitespaces-while-saving-files/3325>\
**Category:** Help\
**Created:** [April 13, 2022, 10:03am UTC](https://discourse.jabref.org/t/how-to-avoid-adding-unnecessary-whitespaces-while-saving-files/3325 "2022-04-13T10:03:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gaochenyi](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/gaochenyi/32/1110_2.png) [@gaochenyi](https://discourse.jabref.org/u/gaochenyi)\
**Post date:** [April 13, 2022, 10:03am UTC](https://discourse.jabref.org/t/how-to-avoid-adding-unnecessary-whitespaces-while-saving-files/3325/1 "2022-04-13T10:03:02Z")

</div>

I am using JabRef 5.5 on macOS 11.5.1. JabRef gives files like this:

```nohighlight
@Article{key,
  author = {Author},
  title = {Title},
  year = {2022},
}

```

I hardly edit bib files directly, so I hardly need the legibility achieved by aligning `=` with extra whitespaces, but on the other hand I do need the disk space occupied by those unnecessary whitespaces since I have a lot of entries. Therefore, I want to have JabRef save bib files like this:

```nohighlight
@Article{key,
  author = {Author},
  title = {Title},
  year = {2022},
}

```

How to achieve this? I searched JabRef preferences and found no solution.

---

<div class="post-metadata">

**Author:** ![MacGyver](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/macgyver/32/845_2.png) [@MacGyver](https://discourse.jabref.org/u/MacGyver)\
**Post date:** [April 13, 2022, 11:19am UTC](https://discourse.jabref.org/t/how-to-avoid-adding-unnecessary-whitespaces-while-saving-files/3325/2 "2022-04-13T11:19:57Z")

</div>

I haven’t found a setting for this. A workaround is to use search/replace of a text editor. But I don’t know if all entries are reformatted next time the database is saved from Jabref (which would make the proposed workaround useless).

---

<div class="post-metadata">

**Author:** ![gaochenyi](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/gaochenyi/32/1110_2.png) [@gaochenyi](https://discourse.jabref.org/u/gaochenyi)\
**Post date:** [April 13, 2022, 12:52pm UTC](https://discourse.jabref.org/t/how-to-avoid-adding-unnecessary-whitespaces-while-saving-files/3325/3 "2022-04-13T12:52:53Z")

</div>

I know how to achieve this with text editor. But every time I add a new entry, extra whitespaces are added to align `=`. Thus, JabRef should be tweaked to not align `=` for new entries. Thanks anyway.

---

<div class="post-metadata">

**Author:** ![ThiloteE](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/thilotee/32/1008_2.png) [@ThiloteE](https://discourse.jabref.org/u/ThiloteE)\
**Post date:** [April 14, 2022, 8:51pm UTC](https://discourse.jabref.org/t/how-to-avoid-adding-unnecessary-whitespaces-while-saving-files/3325/4 "2022-04-14T20:51:52Z")

</div>

The relevant github issue is here: [An option for not aligning `=` when JabRef saves/imports bib files as well as adds new entries · Issue #8676 · JabRef/jabref · GitHub](https://github.com/JabRef/jabref/issues/8676)

```auto
Hi, this is not possible and I doubt we will add this feature. The alignment was done purposefully, so that users with version control systems or other comparison tools have no weird issues when comparing files.
For a history of the format evolution:
https://github.com/JabRef/blog.jabref.org/pull/47/files

On import and file opening, the bib file is read by JabRef's own Bibtex parser and a new library object is created which uses the alignment in the content serialization which is then also written to the file.

```
