I use DB Browser for SQLite to visualize and update an sqlite file.
I am able to do run a case sensitive query to update some text like this:
UPDATE ite
Nosyara answer works great but it only removes 1 instance at a time.
I also tried this from here:
UPDATE itemNotes
SET
note = SUBSTR(note, 0, INSTR(LOWER(note), 'sometext')) || 'abc' || SUBSTR(note, INSTR(LOWER(note), 'sometext')+sometext_len)
WHERE
note LIKE "%sometext%";
But when I have many occurence of sometext
in a field note
, then only the first on is removed. Based on a comment on this question, I ended up using python to replace the sqlite, see here
You need to search substring in LOWER(note)
, but replace it in original.
I don't know where you getting sometext from, assume that you can check it's length.
In following example I'll use constant.
UPDATE itemNotes
SET
note = SUBSTR(note, 0, INSTR(LOWER(note), 'sometext')) || 'abc' || SUBSTR(note, INSTR(LOWER(note), 'sometext')+sometext_len)
WHERE
INSTR(LOWER(note), 'sometext') >= 0;
!Note: It will work only for one replace at a time.