Cleanup entries - Can't get it to work

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

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 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

    works for me, if my filename format pattern is [shorttitle:titlecase]

  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)

    works for me too, if filename format pattern is either [shorttitle] or [shorttitle:titlecase].

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

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?

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.

@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

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:

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:

@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.

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

1 Like

Yup! That seems to work. Thanks <3

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

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

1 Like