I’m using Dataview to display a list of articles (linked title + authors). I’m using regexeplace, to shorten the title (dropping subtitles after the colon), and I’d also like to reduce the author info to surnames only. I’ve experimented and researched regex and substring approaches, but have not found a solution that gets close to working.
My current working code:
TABLE WITHOUT ID
link(file.link, regexreplace(title, ":.*$", "")) AS "Title", authors AS "Authors"
FROM "Literature" AND -#todo/unread
SORT authors asc
WHERE contains(file.name, "@")
To forgo any confusion: the “Where contains” limits to my article notes as these start with “@”.
The current result is:
Title | Authors |
---|---|
Title of article | John Smith, Jane Other |
What I’d like to do is have:
Title | Authors |
---|---|
Title of article | Smith, Jane |
Currently, the authors are a text-field in my properties. I’ve tried reworking them to a list (which would need to be flattened after parsing, right?) Yet, I’m not sure if this is needed or just overcomplicated things.
What is the best approach to streamline the list? I welcome any suggestions to help me further my understanding and note-keeping tactics. Thanks in advance!