I want to extract the \\xxxxxxx04\xxx and \\yyyy03\yyyyyyy from these samples:
\\\\xxxxxxx04\xxx\05. ***\*** **\*****\*****\****.pdf\\\\yyyy03\yyyyyyy\***\*** **\*****\*****\****.html
There are approximately 3,000,000 rows like this.
I am using DB Browser (SQLite), and apparently it doesn't recognize CHARINDEX.
In before, I have tried query
SELECT path
SUBSTR(path, 3, INSTR(SUBSTR(path, 3), '\') - 1) AS server,
FROM results;
but it only returns text before the first \ (xxxxxxx04 and yyyy03).
How can I do this?
You are not far I think, maybe try this :
INSTR(path, '\\')should find position of first backslashSUBSTR(path, INSTR(path, '\\') + 1)should remove everything before first backslashINSTR(SUBSTR(path, INSTR(path, '\\') + 1), '\\')should find position of next backslashSUBSTR(path, INSTR(path, '\\'), INSTR(SUBSTR(path, INSTR(path, '\\') + 1), '\\') + 1)should extract everything between first and second backslash