Notepad ++使用自动增量更改文本

时间:2015-01-05 14:49:23

标签: mysql regex replace notepad++

我有数据库sql文件。我用" 000000000"更改了所有用户名。我想用像这样的记事本++替换它

" school0001"

" school0002"

" school0003"

" school0004"

这是原始的sql代码

(16, 2, '', 0, '000000000', 'e10adc3949ba59abbe56e057f20f883e', 'legacy', '9oV', '2014-12-30', 'homeros61@hotmail.com', 0, '', '', '', '', '', '', '', '', NULL, 0, 2, '', 0, 1419950423, 0, 0, 0, 0, 0, 0, 0, 0, '2', 0, 0, 0, 0, 0, 67127382, NULL, 134217722, '', '0000-00-00', 0, 0, '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, '', 'vb', '', 0, NULL, 0),
(17, 2, '', 0, '000000000', 'e10adc3949ba59abbe56e057f20f883e', 'legacy', 'ZP\\', '2014-12-30', 'boraimer34@hotmail.com', 0, '', '', '', '', '', '', '', '', NULL, 0, 2, '', 0, 1419950423, 0, 0, 0, 0, 0, 0, 0, 0, '2', 0, 0, 0, 0, 0, 67127382, NULL, 134217722, '', '0000-00-00', 0, 0, '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, '', 'vb', '', 0, NULL, 0),
(18, 2, '', 0, '000000000', 'e10adc3949ba59abbe56e057f20f883e', 'legacy', 'jde', '2014-12-30', 'ozgureoner@gmail.com', 0, '', '', '', '', '', '', '', '', NULL, 0, 2, '', 0, 1419950423, 0, 0, 0, 0, 0, 0, 0, 0, '2', 0, 0, 0, 0, 0, 67127382, NULL, 134217722, '', '0000-00-00', 0, 0, '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, '', 'vb', '', 0, NULL, 0),
(19, 2, '', 0, '000000000', 'e10adc3949ba59abbe56e057f20f883e', 'legacy', 'drQ', '2014-12-30', 'muzo-0511@hotmail.com', 0, '', '', '', '', '', '', '', '', NULL, 0, 2, '', 0, 1419950423, 0, 0, 0, 0, 0, 0, 0, 0, '2', 0, 0, 0, 0, 0, 67127382, NULL, 134217722, '', '0000-00-00', 0, 0, '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, '', 'vb', '', 0, NULL, 0),

我想要这样

(16, 2, '', 0, 'school0001', 'e10adc3949ba59abbe56e057f20f883e', 'legacy', '9oV', '2014-12-30', 'homeros61@hotmail.com', 0, '', '', '', '', '', '', '', '', NULL, 0, 2, '', 0, 1419950423, 0, 0, 0, 0, 0, 0, 0, 0, '2', 0, 0, 0, 0, 0, 67127382, NULL, 134217722, '', '0000-00-00', 0, 0, '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, '', 'vb', '', 0, NULL, 0),
(17, 2, '', 0, 'school0002', 'e10adc3949ba59abbe56e057f20f883e', 'legacy', 'ZP\\', '2014-12-30', 'boraimer34@hotmail.com', 0, '', '', '', '', '', '', '', '', NULL, 0, 2, '', 0, 1419950423, 0, 0, 0, 0, 0, 0, 0, 0, '2', 0, 0, 0, 0, 0, 67127382, NULL, 134217722, '', '0000-00-00', 0, 0, '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, '', 'vb', '', 0, NULL, 0),
(18, 2, '', 0, 'school0003', 'e10adc3949ba59abbe56e057f20f883e', 'legacy', 'jde', '2014-12-30', 'ozgureoner@gmail.com', 0, '', '', '', '', '', '', '', '', NULL, 0, 2, '', 0, 1419950423, 0, 0, 0, 0, 0, 0, 0, 0, '2', 0, 0, 0, 0, 0, 67127382, NULL, 134217722, '', '0000-00-00', 0, 0, '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, '', 'vb', '', 0, NULL, 0),
(19, 2, '', 0, 'school0004', 'e10adc3949ba59abbe56e057f20f883e', 'legacy', 'drQ', '2014-12-30', 'muzo-0511@hotmail.com', 0, '', '', '', '', '', '', '', '', NULL, 0, 2, '', 0, 1419950423, 0, 0, 0, 0, 0, 0, 0, 0, '2', 0, 0, 0, 0, 0, 67127382, NULL, 134217722, '', '0000-00-00', 0, 0, '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, '', 'vb', '', 0, NULL, 0),

2 个答案:

答案 0 :(得分:1)

我想分享我的答案。

下载textpad并用\ i

替换所有0000000

如果你想要,你可以这样做。

Searching text: 0000000
Replace with: school\i

输出:school1,school2,school3,school4,school5以及你有多少相同的文字......

\i Replace with numbers starting from 1, incrementing by 1. 
\i(10) Replace with numbers starting from 10, incrementing by 1. 
\i(0,10) Replace with numbers starting from 0, incrementing by 10. 
\i(100,-10) Replace with numbers starting from 100, decrementing by -10. 

答案 1 :(得分:0)

SynWrite应用。

  • 在插件管理器中安装“插入编号”插件
  • 使用Ctrl + Shift +单击(请参阅帮助),在所有单词上放置多个插入符号。
  • 调用“工具/插件/插入符编号”