Manage Zotfile's user wildcards

edited May 7, 2020
I want to use Zotfile's renaming feature such that the authors' last name is in uppercase. I tried

{
"1": {
"default": {
"field": "author",
"transform": "toUpperCase"
}
}
}

Unfortunately, this only capitalises the first letter but not the whole name (e.g. "Einstein" instead of "EINSTEIN"). Is it possible to capitalise the whole name, and if so, could you guide me?
  • edited May 6, 2020
    .
  • edited May 6, 2020
    @leonryrko: For examples how to set up Zotfile's user wildcards, it's best to first have a look at its default wildcards, see here. (Note that some of the examples on the Zotfile website are outdated.)

    What you want to do should be possible with this user wildcard:
    {"1": {"field": "author", "operations":[{"function": "toUpperCase"}]}}.
    For more examples, see the discussion here.
  • edited May 7, 2020
    @qqbb Thank you very much, that works! I can even add other operations to it, as for instance with
    {
    "1": {
    "default": {
    "field": "author",
    "operations": [
    {
    "function": "toUpperCase"
    },
    {
    "function": "replace",
    "regex": "[-]",
    "replacement": "_"
    }
    ]
    }
    }
    }

    I will check out other examples, too.
  • Hi @leonryrko and @qqbb

    I tried to uppercase the last name with your code but it didn't work.
    I put the code on zotfile.wildcards.user and my renaming rules is set to {%a}, {%A}. - {%t} {%y}

    I'm missing something here?
  • The wildcard above has a name “%1”. %A and %a are both default wildcards.
Sign In or Register to comment.