从Notepad++文件中删除行号

4

我收到了一个非常长的文件。它有1000多行SQL代码。每一行都以行号开头。

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

我想使用NotePad++的查找和替换功能仅删除行号。是否有可用的正则表达式来完成此操作?

4个回答

12

1
那是你的Notepad++吗?你用什么样式(主题)? :) 我现在用的是twilight,但有时我会选择Zenburn。另外+1。漂亮显示。 - konsolebox
1
@konsolebox 我的是“深黑色”,因为我使用了一个最初就是基于这个主题格式化的用户定义语言。顺便说一下,“暮光之城”也很不错:D - P0W
我会有空的时候试试,只是为了好玩 :) - konsolebox

5

感谢您的努力! - Umesh Patil
即使在行首有一个小空格,"^\s*\d+" 也能正常工作 :) - Umesh Patil

3
使用CTRL+H打开替换窗口,然后按以下设置运行Replace All
  1. 查找内容:^\s*\d+
  2. 替换为:(空)
  3. 搜索模式:正则表达式
备注:
  • \s也可以是[[:space:]][ \t]
  • \d也可以是[[:digit:]][0-9]
  • 如果新的编辑正确,则可能不需要匹配前导空格的模式\s*

0

如果数字后面有冒号,您可以使用这个。

^\d+:

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接