This must have been asked before but can't find the answer I need.
I have a very large file with a long string of integers separated by spaces. The intergers are 3 or 4 characters long.
I want to separate the rows so that I end up with 5 columns of numbers.
I am trying to do this with notepad++ as its the only tool at my disposal at the moment.
Example of what I have
123 123 123 123 123 123 123 123 123 123 456 456 456 456 456 456 1231 2312 3112 1534 1254 1254 1254 2154 1522 1233 1235 1231 1234
1123 4564 1534 1321 1234 1234 1234 1234 1234 123 123 123 123 123 123 132 123 123
1234 1234 1234 1234 4567 4567 4567 4567 4567 145 154 154 154
What I need is
123 123 123 123 123
123 123 123 123 123
456 456 456 456 456
456 1231 2312 3112 1534
1254 1254 1254 2154 1522
1233 1235 1231 1234 1123
4564 1534 1321 1234 1234
1234 1234 1234 123 123
123 123 123 123 132
123 123 1234 1234 1234
1234 4567 4567 4567 4567
4567 145 154 154 154
Things are complicated by the fact that the rows are not equal length.
Hope someone can help.
PS: would be good if the final example had the spaces replaced with tabs also!
All these replacements are done with regular expressions and ". matches newline":
\s+
with a space((\d+\s+){5})
with \1\n
\t
(can also do it at the beginning)Note that it doesn't look good with the default tab size of 4 however. You need at least 5 for your example.
Find what: (\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+
Replace with: \1 \2 \3 \4 \5\n
(respectively \1\t\2\t\3\t\4\t\5\n
to replace spaces with tabs)
Search Mode: Regular expression
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With