zotfile
zotfile copied to clipboard
How to use "date added" to rename files
I already read the description and this question but still don't know how to write the right sentence. I've tried several times. the example "%4" doesn't seem like it matches that description Could you help me with it?
Could you please be a bit more specific about what you've tried? Have you copy and pasted the custom JSON (found here and quoted below for easy access) into your zotfile.wildcards.user preference?
{
"1": "publicationTitle",
"2": {
"default": "publicationTitle",
"book": "publisher",
"bookSection": "publisher"
},
"3": {
"field": "title",
"regex": "([\\w ,-]{1,50})[:\\.?!]?",
"group": 1
},
"4": {
"default": {
"field": "title",
"regex": "([\\w ,-]{1,10})[:\\.?!]?",
"group": 1,
"transform": "upperCase"
},
"journalArticle": "publicationTitle"
}
}
After some research, it seems that the example JSON has changed. The correct one for #130 should be:
{
"1": "publicationTitle",
"2": {
"default": "publicationTitle",
"book": "publisher",
"bookSection": "publisher"
},
"3": {
"field": "title",
"operations": [{
"function":"exec",
"regex": "([\\w ,-]{1,50})[:\\.?!]?",
"group": 1
}]
},
"4": {
"field":"dateAdded",
"operations": [{
"function": "replace",
"regex": "(\\d{4})-(\\d{2})-(\\d{2})(.*)",
"replacement": "$1$2$3",
"flags":"g"
}]
},
"5": {
"default": {
"field": "title",
"operations": [
{
"function":"replace",
"regex": "\\d",
"replacement": ""
},
{
"function": "exec",
"regex": "([\\w ,-]{1,10})[:\\.?!]?",
"group": 1
},
{
"function": "toUpperCase"
},
{
"function": "trim"
}
]
},
"journalArticle": "publicationTitle"
}
}