Hello, @garbage-gold, @astrosofista and All,
Of course, regexes cannot perform, generally, mathematical operations, but we can cheat a bit !
First, open the Replace dialog
SEARCH (?<=\d)\R ( or (?<=\w)\R if your text contains words instead of numbers )
REPLACE \t
If necessary, tick the Wrap around option
Select the Regular expression search mode
Click on the Replace All button
=> Your text in changed as below, with a TAB char between each word :
358 293 commit;
866 511 commit;
58 767 commit;
562 644 commit;
163 569 commit;
414 305 commit;
Notes
This regex S/R looks for any EOL character(s), which is/are preceded with a number ( (?<=\d) ) ( or a word if (?<=\w) )
And replaces it with a tabulation character ( \t )
Now, put the caret at the end of the first line
Open the column editor ( Alt + C )
Select Number to Insert
Type in 1 in all the zones
If necessary, tick the Leading zeros option
Click on the OK button
Remove additional numbers on possible empty lines, at the end of the list
You should get :
358 293 commit;1
866 511 commit;2
58 767 commit;3
562 644 commit;4
163 569 commit;5
414 305 commit;6
Finally, perform the last regex S/R, below :
SEARCH \t
REPLACE \r\n ( or \n only for Unix files )
Here is your expected text :
358
293
commit;1
866
511
commit;2
58
767
commit;3
562
644
commit;4
163
569
commit;5
414
305
commit;6
Et voilà !
Best Regards,
guy038