This sounds like something that can be done programmatically, either via the Joplin's data API, or with a package such as joppy. You'll have to write a script for this, but GPT can help.