# Cleanup entries - Can't get it to work

**URL:** <https://discourse.jabref.org/t/cleanup-entries-cant-get-it-to-work/3999>\
**Category:** Help\
**Tags:** entry-editor\
**Created:** [September 29, 2023, 9:41pm UTC](https://discourse.jabref.org/t/cleanup-entries-cant-get-it-to-work/3999 "2023-09-29T21:41:19Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![thecaligarmo](https://avatars.discourse-cdn.com/v4/letter/t/c77e96/32.png) [@thecaligarmo](https://discourse.jabref.org/u/thecaligarmo)\
**Post date:** [September 29, 2023, 9:41pm UTC](https://discourse.jabref.org/t/cleanup-entries-cant-get-it-to-work/3999/1 "2023-09-29T21:41:19Z")

</div>

I’m tryin got use the “Cleanup entries” stuff, but I can’t seem to get it to edit any file. Am I just using it wrong? In particular, here is what I’m doing:

1. Click on the entry I want to edit
2. Click on the broom icon (The “cleanup entries” icon)
3. Setup the things I want and click “ok”

when I do this nothing happens. In particular, the two things I _want_ to happen are:

1. Rename PDFs to given filename format pattern
2. Field Formatters (Title → Title Case)

The title doesn’t change at all and the pdf doesn’t get altered either. No error message is produced and it seems like nothing runs at all. Am I doing something wrong?

I’m using Jabref 5.10

---

<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:** [September 30, 2023, 1:21pm UTC](https://discourse.jabref.org/t/cleanup-entries-cant-get-it-to-work/3999/2 "2023-09-30T13:21:06Z")

</div>

Hello, I just tried to reproduce your issue and found some irregularities but I am still testing.

Could you please provide the entry to us? Just copy and paste from the biblatex source tab to here and press the preformated text button (ctrl + e). Same for your filename format pattern.

What I already found out is:

1. Rightclick in the General tab and choose “Rename file to a defined pattern” in general works, but when using the [shorttitle] format pattern, single characters like `a a a` will not be written. Full words ala `aaa aaa aaa` will be written. Attaching :titlecase to shorttitle (e.g. [shorttitle:titlecase] as documented at [Customize the citation key generator - JabRef](https://docs.jabref.org/setup/citationkeypatterns#modifiers) **works**! So a title of “aaa Aaa aaa bbb” turns into “Aaa Aaa Aaa”, but “a a a” will turn into " ". Also, if the defined pattern is already perfectly similar to what the filename is named, then the right-click menu will be grey and cannot be selected, which is fine.

2. Click on the entry I want to edit  
Click on the broom icon (The “cleanup entries” icon)  
Setup the things I want and click “ok”  
Rename PDFs to given filename format pattern

3. Click on the entry I want to edit  
Click on the broom icon (The “cleanup entries” icon)  
Setup the things I want and click “ok”  
Rename PDFs to given filename format pattern  
Field formatters (Title → Title case)

I cannot reproduce your problems with the newest development version of JabRef.

---

<div class="post-metadata">

**Author:** ![thecaligarmo](https://avatars.discourse-cdn.com/v4/letter/t/c77e96/32.png) [@thecaligarmo](https://discourse.jabref.org/u/thecaligarmo)\
**Post date:** [September 30, 2023, 3:20pm UTC](https://discourse.jabref.org/t/cleanup-entries-cant-get-it-to-work/3999/3 "2023-09-30T15:20:48Z")

</div>

I have over 1,300 entries in my bibtex, so it’s a little hard to just copy and paste in here .\_. I was using the auto add feature (“lookup” → “Search for unlinked local files”) which then added all of my files. There’s quite a few issues/problems and so I was hoping to auto edit/cleanup the file in order to try and have to do less work in the future. I also wanted it to auto organise the files in to a nice structure.

Some notes to answer some of your questions.

1. This happens on _every_ file I try and cleanup. It doesn’t matter if I choose 1 file, 2 files, all files. I’ve tried at least 10 random files and none of them want to “cleanup”.
2. The Broom has the “field Formatter” of “Title → Title Case” and that is the part that doesn’t seem to be working.
3. The filename format pattern is: “[title] - [authors]” (Inside the “Linked Files” settings section I also have a File directory pattern set to “[GROUPS]”. In addition, the File directory is set to “relative to library”.)

I thought that this was maybe just a me issue, but sounds like a potential bug? Should I create a github issue and then link everything on there so you can play around with exactly what I have since I can’t upload things on the forum?

---

<div class="post-metadata">

**Author:** ![thecaligarmo](https://avatars.discourse-cdn.com/v4/letter/t/c77e96/32.png) [@thecaligarmo](https://discourse.jabref.org/u/thecaligarmo)\
**Post date:** [September 30, 2023, 4:08pm UTC](https://discourse.jabref.org/t/cleanup-entries-cant-get-it-to-work/3999/4 "2023-09-30T16:08:37Z")

</div>

Some other notes.

1. If I right-click the file itself in the entry and click on “Move file to file directory and rename file” it does exactly what I would want
2. If I right-click the title, I can title case it no problem.

It seems like the main issue is the broom/cleanup tool. But there’s no error codes being generated so I can’t tell what’s necessarily wrong.

---

<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:** [October 1, 2023, 11:17am UTC](https://discourse.jabref.org/t/cleanup-entries-cant-get-it-to-work/3999/5 "2023-10-01T11:17:24Z")

</div>

@thecaligarmo Can you please test the newest development version? I found some issue that potential exceptions from cleanup were not displayed

Remember to make a backup before trying out the new version

> **[index - powered by h5ai v0.30.0 (https://larsjung.de/h5ai/)](https://builds.jabref.org/main/)**
>
> index - powered by h5ai v0.30.0 (https://larsjung.de/h5ai/)

---

<div class="post-metadata">

**Author:** ![thecaligarmo](https://avatars.discourse-cdn.com/v4/letter/t/c77e96/32.png) [@thecaligarmo](https://discourse.jabref.org/u/thecaligarmo)\
**Post date:** [October 1, 2023, 12:51pm UTC](https://discourse.jabref.org/t/cleanup-entries-cant-get-it-to-work/3999/6 "2023-10-01T12:51:42Z")

</div>

Just tried it on a test version and it threw an error =D It says  
“Cannot invoke “java.lang.CharSequence.length()” because “this.text” is null”  
Here’s the full error:

```auto
java.lang.NullPointerException: Cannot invoke "java.lang.CharSequence.length()" because "this.text" is null
	at java.base/java.util.regex.Matcher.getTextLength(Unknown Source)
	at java.base/java.util.regex.Matcher.reset(Unknown Source)
	at java.base/java.util.regex.Matcher.<init>(Unknown Source)
	at java.base/java.util.regex.Pattern.matcher(Unknown Source)
	at org.jabref@5.11.210/org.jabref.logic.cleanup.URLCleanup.cleanup(Unknown Source)
	at org.jabref@5.11.210/org.jabref.logic.cleanup.CleanupWorker.cleanup(Unknown Source)
	at org.jabref@5.11.210/org.jabref.gui.cleanup.CleanupAction.doCleanup(Unknown Source)
	at org.jabref@5.11.210/org.jabref.gui.cleanup.CleanupAction.cleanup(Unknown Source)
	at org.jabref@5.11.210/org.jabref.gui.cleanup.CleanupAction.lambda$execute$1(Unknown Source)
	at org.jabref@5.11.210/org.jabref.gui.util.BackgroundTask$2.call(Unknown Source)
	at org.jabref@5.11.210/org.jabref.gui.util.BackgroundTask$2.call(Unknown Source)
	at org.jabref@5.11.210/org.jabref.gui.util.DefaultTaskExecutor$1.call(Unknown Source)
	at org.jabref.merged.module@5.11.210/javafx.concurrent.Task$TaskCallable.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

```

I tried it on the following bibtex entry:

```auto
@Misc{Martino2001,
  author = {Martino, Ivan},
  title = {EFFICIENCY AXIOMS FOR SIMPLICIAL COMPLEXES},
  year = {2001},
  abstract = {We study the notion of efficiency for cooperative games on simplicial complexes. In such games, the grand coalition [n] may be forbidden, and, thus, it is a non-trivial problem to study the total number of payoff v ∆ of a cooperative game (∆, v). We address this question in the more general setting, by characterizing the individual values that satisfy the general efficient requirement, that is v gen ∆ = T ∈∆ a T v(T) for a generic assignment of real coefficients a T. The traditional and the probabilistic efficiency are treated as a special case of this general efficiency. Finally, we introduce a new notion of efficiency arising from the combinatorial and topological property of the simplicial complex ∆. The efficiency in this scenario is called simplicial and we characterize the individual values fulfilling this constraint.},
  file = {:C\:/TestJabref/Journals/arXiv/Efficiency axioms for simplicial complexes - Ivan Martino.pdf:PDF},
  groups = {arXiv},
  priority = {prio1},
}

```

_Note:_ I tried it with and without the abstract and got the error both times.

---

<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:** [October 1, 2023, 1:07pm UTC](https://discourse.jabref.org/t/cleanup-entries-cant-get-it-to-work/3999/7 "2023-10-01T13:07:57Z")

</div>

Ah thanks a lot! I could now reproduce it as well. Can you disable the checkbox “Move URL in note field to url field” and test again?

A fix is on its. way

---

<div class="post-metadata">

**Author:** ![thecaligarmo](https://avatars.discourse-cdn.com/v4/letter/t/c77e96/32.png) [@thecaligarmo](https://discourse.jabref.org/u/thecaligarmo)\
**Post date:** [October 1, 2023, 5:26pm UTC](https://discourse.jabref.org/t/cleanup-entries-cant-get-it-to-work/3999/8 "2023-10-01T17:26:37Z")

</div>

Yup! That seems to work. Thanks \<3

---

<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:** [October 1, 2023, 5:44pm UTC](https://discourse.jabref.org/t/cleanup-entries-cant-get-it-to-work/3999/9 "2023-10-01T17:44:14Z")

</div>

Okay, great to hear! you can now also use the latest development version with the fix included

> **[index - powered by h5ai v0.30.0 (https://larsjung.de/h5ai/)](https://builds.jabref.org/main/)**
>
> index - powered by h5ai v0.30.0 (https://larsjung.de/h5ai/)

If you notice any other issues/errors/oddities please report them here or at github
