What I’m trying to do
I use Dataview queries to automatically find all the files whose filename contains the author’s surname and populate the author’s bio page when I create it. I have a template I use to create the author’s bio page, which contains the following dataview query (I create new author bios by using the author’s surname as the original file name and add the given name after using the template, so {{title}} will always contain the surname).
dataview
TABLE description as "In brief"
WHERE contains(file.name, "{{title}}")
SORT Created DESC
However, a lot of my authors have names with umlauts or accents (say, Pietiläinen), whereas my citation manager (Zotero) strips those from the citekeys I use as a part of the filename (so a note I create from an article “Pietiläinen A. B., 2020, Things I’ve Seen” would have “Pietilainen2020” in the filename.
So far I’ve just included an additional OR statement manually, as follows:
dataview
TABLE description as "In brief"
WHERE contains(file.name, "Pietiläinen") OR contains(file.name, "Pietilainen")
SORT Created DESC
But I was wondering if there’s an automated way to convert strings with accented characters into strings without, like the lower function does to convert strings into lowercase?
Things I have tried
I tried using the replace function and it works fine for single characters, like
WHERE contains(file.name, replace("Pietiläinen","ä","a"))
But can I somehow replace multiple characters at once?
For example,
WHERE contains(file.name, replace("Pietiläinen",["ä"],["a"]))
finds all the notes…
What I’d like to do is to have a template that takes the {{title}} and automatically replaces all the troublesome characters (e.g. á, ä, å, é, ó, ö,…) with their equivalents (a, a, a, e, o, o,…), something like this:
dataview
TABLE description as "In brief"
WHERE contains(file.name, replace("{{title}}",[characters to replace], [characters to replace with])
SORT Created DESC
Is this possible without going to Javascript?