Removing line numbers from a Notepad ++ file

I got a very long file. It has 1000 lines of SQL code. Each line begins with a 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 the NotePad ++ Find + Replace function. Is there any regex to accomplish this?

+4
source share
4 answers

This use of regex is the easiest way.

Another convenient way (scrolling 1K lines is not much IMO) could be:

Select a block with a key ALTand drag the mouse, as shown below:

enter image description here

+12
source

You can use this regex:

^\d+

Working demo

+4

"" CTRL + H Replace All :

  • : ^\s*\d+
  • : ()
  • :

:

  • \smay also be [[:space:]]or[ \t]
  • \dmay also be [[:digit:]]or[0-9]
  • If the new edit is correct, a template \s*that matches the master space may not be needed.
+3
source

You can use this if you have a colon after numbers

^\d+:
0
source

All Articles