ZotFile / Zotero Renaming Rules for Colon and Question Marks

Hi all,

First of just wanted to say how impressed I am with the software - both Zotfile and Zotero itself. They're pretty great but I do have one small question that's been bugging me.

I'm basically using Zotfile to rename hundreds upon hundreds of pdfs that I've accumulated over the years (process of retrieving metadata from all pdfs that I've copied into my library, renaming the attachments/pdfs with the managing attachments option and then exporting the newly named pdf files)

Everything works perfectly but there's two tiny little things I'd like to change.

Question marks and colons in the title of articles are replaced with a hyphen. I'd like to replace a) question marks with an inverted question mark because windows actually supports inverted question marks within the naming of its files, and b) colons with semi-colons because, again, windows supports semi-colons in the naming of its file types.

I've had a read at the user-defined wildcards of the Zotfile documentation but have had no success in finding a way to make the small above change. Basically I just want to change the two special characters of a question mark and colon to my own file-naming supported characters - an inverted question mark and semi colon.

Is this currently possible within Zotero/Zotfile? And if so, does anyone have any ideas how this can be done? I really am at a loss unfortunately.

Many thanks!
  • You will want to disable the option to truncate titles after .:? in the Zotfile preferences.

    Then, a wildcard like this should do the replacements that you want:
    "W": { "field": "title",
    "operations": [ { "function": "replace", "regex": "\\?", "replacement": "¿", "flags": "g" },
    { "function": "replace", "regex": ":", "replacement": ";", "flags": "g" } ] }

    You can play around with the regex here.

    (Note that Zotfile's implementation of regex is somewhat non-standard. Zotfile's escape character is "\\" rather than the standard "\". So, when testing the first regex above at the tester site, you should use "regex":"\?" instead.)
  • I'm getting a weird character before the inverted question mark:

    A dinosaur missing-link¿ Chilesaurus...

    Should be:

    A dinosaur missing-link¿ Chilesaurus...

    Any suggestions?
Sign In or Register to comment.