Since SQLite can’t do INSTR (Oracle/MySQL), SUBSTRING_INDEX (MySQL) or CHARINDEX (SQL Server), this is an attempt to do it with help of Python.
It’s one of my very first experiments with Python (although I’m falling in love already :) ) so will need to revisit the actual code, marking it as drafts meanwhile.