I want to convert all numbers to a single line per number
-
Hello mates,
Please I need help.
I want to convert all numbers in my notepad++ on a single row to a single line per number. That is each number should be on a single line.
For example;34566, 46664, 67575, 78787,
to
34566
46664
67575
78787I’ll be waiting for your swift response.
Thanks -
Try this:
Invoke Replace dialog (default key: ctrl+h)
Find what zone:, ?
Replace with zone:\r\n
Wrap around checkbox: ticked or unticked, as you like
Search mode selection: Regular expression
Action: Press Replace All buttonHere’s how it works:
THE FIND EXPRESSION:
, ?- [Match the character “,” literally][1 ]
, - [Match the character “ ” literally][1 ]
?- [Between zero and one times, as many times as possible, giving back as needed (greedy)][2 ]
?
- [Between zero and one times, as many times as possible, giving back as needed (greedy)][2 ]
THE REPLACE EXPRESSION:
\r\n- [Insert a carriage return][3 ]
\r - [Insert a line feed][3 ]
\n
Created with RegexBuddy
[1 ]: https://www.regular-expressions.info/characters.html
[2 ]: https://www.regular-expressions.info/optional.html
[3 ]: https://www.regular-expressions.info/replacenonprint.htmlRegexBuddy settings to emulate N++ regex engine: Application=boost::regex 1.54-1.57 / flavor=Default flavor / replacement flavor=All flavor / ^$ match at line breaks / Numbered capture / Allow zero-length matches
- [Match the character “,” literally][1 ]
-
Thanks Scott.
It works perfectly.
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