1

I'm working on a project that pulls 100,000+ records from a CSV into a SQLite database. I only get ~55 records a second on the device its intended for. It seems using Transactions may speed up this process but my implementations haven't been successful and I haven't found a useful example. Does anyone have a suggestion or a Transaction example that speeds up the following code block?

Thank you.

        while (currPos < vFileObj.Pos) {
        currPos = vFileObj.Pos;
        if (readLine.length > 1) {
            readSplit = readLine.split('\",\"');
            readSplit[0] = readSplit[0].replace(/[^a-zA-Z0-9]/g,'');
            readSplit[1] = readSplit[1].replace(/[\[\]|#,+()$~%'":*?<>{}]/g,' ');
            readSplit[2] = readSplit[2].replace(/[\[\]|#,+()$~%'":*?<>{}]/g,' ');
            readSplit[3] = readSplit[3].replace(/[\[\]|#,+()$~%'":*?<>{}]/g,' ');
            readSplit[4] = readSplit[4].replace(/[\[\]|#,+()$~%'":*?<>{}]/g,' ');
            dbOps.Insert('INSERT INTO valid ("col0", "col1", "col2", "col3", "col4") VALUES("' + readSplit[0] + '","' + readSplit[1] + '","' + readSplit[2] + '","' + readSplit[3] + '","' + readSplit[4] + '")');
            readLine = fileOps.Read(vFileObj);
        }
    }
4

0 回答 0