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
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login