首页 > 解决方案 > SQL Batch editing with Regexp (i think)

问题描述

So before starting, i just want to say that i know basically nothing about sql and didn't choose this format, i just dont have a different choice for the program using this file.

I have a sql database and i need to make some changes to it. My Problem is the following: One of the tables, which has over 2000 rows of entries, has a column with this format: string0 / string1 / string2 / string3 .... The program seperates the strings at the "/" and uses the seperated strings. What i need to do is clone string2 and insert the clone as string3. This should create something like this: string0 / string1 / string2 / string2clone / string3 ... As i have no experience with sql i dont even know if this is possible but my best guess would be to batch edit all values with a regexp. I'm currently only using DB Browser for SQL.

标签: sqlregexdatabasesqlite

解决方案


Do you have upload access? 2000 rows is small. I would copy paste it in to Excel, add in the your duplicate string and re-upload.

In SQL you could break apart the column, create a duplicate column of string 2 and concatenate it back together...not the approach I would take but it would definitely depend on your read/write access.


推荐阅读