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
( whered
represents a singledigit
and•••••
any range of characters ) into7
parts which are stored as group1
,2
,… up to7
Then, 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 around
option -
Select the
Regular expression
search mode -
Click once on the
Replace All
button or several times on theReplace
button
Notes :
-
The first part
(?-s)
ensures that each regex.
symbol will match a single standard character only -
Note that any
\d
syntax represents an individual digit, possibly repeated -
Any part
.+?
stands for the smallest range of non-null standard characters between two numbers -
Each group
n
is created by embedding an expression between parentheses, in the search regex and re-used , in replacement, with the\n
syntax
Best Regards
guy038
-
-
Thank you!! @guy038
I got it and I got the idea thanks for further explanations