Reorganize numbers
-
Hello
I have a form like this:
seven characters - three numbers - two - two numbers
live example:
7777777 - 123 - 12 - 12
I want to reorganize the form and put every three i have in list in the last of the line
to become like this
7777777 - 12 - 12 - 123is this possible by using notepad++?
Thanks! -
“-” is just for separation purpose my form has no “-” inlcluded just spaces
-
Hello, @handa-flocka, and All,
No problem with the regular expression support, natively included within Notepad++ !!
We’re going to divide any line, with the layout
dddddd•••••ddd•••••dd•••••dd( wheredrepresents a singledigitand•••••any range of characters ) into7parts which are stored as group1,2,… up to7Then, in replacement, we just re-organize the order of these seven groups !
-
Open the Replace dialog (
Ctrl + H) -
SEARCH
(?-s)^(\d{7})(.+?)(\d{3})(.+?)(\d\d)(.+?)(\d\d)$ -
REPLACE
\1\2\7\4\5\6\3 -
Tick preferably the
Wrap aroundoption -
Select the
Regular expressionsearch mode -
Click once on the
Replace Allbutton or several times on theReplacebutton
Notes :
-
The first part
(?-s)ensures that each regex.symbol will match a single standard character only -
Note that any
\dsyntax represents an individual digit, possibly repeated -
Any part
.+?stands for the smallest range of non-null standard characters between two numbers -
Each group
nis created by embedding an expression between parentheses, in the search regex and re-used , in replacement, with the\nsyntax
Best Regards
guy038
-
-
Thank you!! @guy038
I got it and I got the idea thanks for further explanations