ar newitem = JSON.parse(itmstr);
            ++matchcount;
            db[selids[i]] = newitem;
        } catch (e) {
            console.log("Error replacing string: " + e);
        }
    }

    contentsDiv.innerText = `Replaced ${matchcount} matching elements`;
    contentsDiv.scrollTop = 0;

}

var tempfileurl = null;
var tempfileobj = [];
function erasesel()
{
    const contentsDiv = document.getElementById('contents');
    tempfileobj = [];
    for(let i=0;i<currdbidxs.length;++i)
 