[英]Remove Line numbers from Notepad++ file
I have received a very long file. 我收到了一个很长的文件。 It has 1000+ lines of SQL code.
它有1000多行SQL代码。 Each line start with line number.
每行以行号开头。
14 PROCEDURE sp_processRuleset(pop_id IN NUMBER);
15
16 -- clear procedure for preview mode to clean crom_population_member_temp table and global variables
17 PROCEDURE sp_commit; -- 28-Oct-09 J.Luo
18
19 -- The rule Set string for the Derived Population Member Preview
20 -- The preview mode will set gv_context_ruleSet by setContext_ruleSet,
21 -- sp_processRuleset uses gv_context_ruleSet to build derived population instead of getting rules from crom_rule_set table
22 gv_context_ruleSet VARCHAR2(32767) := NULL; -- 27-Oct-09 J.Luo
23 -- The population Role Id for the Derived Population Member Preview
I want to remove only line numbers using NotePad++ Find+Replace functionality. 我想使用NotePad ++ Find + Replace功能仅删除行号。 Is there any regex available to get this done ?
是否有任何正则表达式可以完成这项工作?
This using regex is the easiest way. 使用正则表达式是最简单的方法。
Other handy way (scrolling a 1K lines is not much IMO) could be : 其他方便的方式(滚动1K行不是很多IMO)可能是:
Block Selection using ALT key and dragging your mouse, like following: 使用ALT键和拖动鼠标进行块选择 ,如下所示:
Open Replace window with CTRL + H and run Replace All with these settings: 使用CTRL + H打开替换窗口并使用以下设置运行全部替换 :
^\\s*\\d+
^\\s*\\d+
Notes: 笔记:
\\s
can also be [[:space:]]
or [ \\t]
\\s
也可以是[[:space:]]
或[ \\t]
\\d
can also be [[:digit:]]
or [0-9]
\\d
也可以是[[:digit:]]
或[0-9]
\\s*
that matches the leading space may not be needed. \\s*
。 如果数字后面有冒号,你可以使用这个
^\d+:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.