如何用记事本++中的改动替换每一行的特定单词
How to replace specific words of each line with an alteration in notepad++
我有一个这样的 sql 文件:
Create new-table1 ... As select ..from table1;
Create new-table2 ... As select ..from table2;
Create new-table3 ... As select ..from table3;
等等..
我需要做的是在每一行的末尾附加一个 WHERE 子句,这样查询就会像:
Create new-table1 ... As select ..from table1 where 1000<=(select count(1) from table1);
Create new-table2 ... As select ..from table2 where 1000<=(select count(1) from table2);
Create new-table3 ... As select ..from table3 where 1000<=(select count(1) from table3);
等等...
对于 1000 行以下的所有 table,基本上新的 table 将为空。
有没有一种方法可以使用 notepad++ 编辑(查找和替换)我的文件,以便我可以添加此 where 子句?
您可以在正则表达式模式下尝试以下查找和替换:
Find: from (\w+);$
Replace: from where 1000 <= (select count(1) from );
我有一个这样的 sql 文件:
Create new-table1 ... As select ..from table1;
Create new-table2 ... As select ..from table2;
Create new-table3 ... As select ..from table3;
等等..
我需要做的是在每一行的末尾附加一个 WHERE 子句,这样查询就会像:
Create new-table1 ... As select ..from table1 where 1000<=(select count(1) from table1);
Create new-table2 ... As select ..from table2 where 1000<=(select count(1) from table2);
Create new-table3 ... As select ..from table3 where 1000<=(select count(1) from table3);
等等...
对于 1000 行以下的所有 table,基本上新的 table 将为空。
有没有一种方法可以使用 notepad++ 编辑(查找和替换)我的文件,以便我可以添加此 where 子句?
您可以在正则表达式模式下尝试以下查找和替换:
Find: from (\w+);$
Replace: from where 1000 <= (select count(1) from );