Hello, @barry-lort, @peterjones and All,
@barry-lort, here is an other method to solve your problem !
Let’s suppose that your file contains 100 lines, so 50 lines beginning with #SERVICE and 50 lines beginning with #DESCRIPTION, as below :
#SERVICE:4:8:1:6:0
#DESCRIPTION Angus
#SERVICE:4:7:0:3:0:
#DESCRIPTION Ayrshire
#SERVICE:5:8:4:1:0
#DESCRIPTION Brown-Swiss
#SERVICE:3:6:7:1:0
#DESCRIPTION Galloway
#SERVICE:4:9:2:5:0
#DESCRIPTION Guernsey
#SERVICE:6:4:7:8:0
#DESCRIPTION Hereford
#SERVICE:2:7:4:1:0
#DESCRIPTION Holstein
#SERVICE:6:4:2:9:0
#DESCRIPTION Piedmontese
#SERVICE:3:6:3:1:0
#DESCRIPTION Scottish-Highland
#SERVICE:4:4:9:3:0
#DESCRIPTION Shorthorn
#SERVICE:4:8:1:6:0
#DESCRIPTION Angus
#SERVICE:4:7:0:3:0:
#DESCRIPTION Ayrshire
#SERVICE:5:8:4:1:0
#DESCRIPTION Brown-Swiss
#SERVICE:3:6:7:1:0
#DESCRIPTION Galloway
#SERVICE:4:9:2:5:0
#DESCRIPTION Guernsey
#SERVICE:6:4:7:8:0
#DESCRIPTION Hereford
#SERVICE:2:7:4:1:0
#DESCRIPTION Holstein
#SERVICE:6:4:2:9:0
#DESCRIPTION Piedmontese
#SERVICE:3:6:3:1:0
#DESCRIPTION Scottish-Highland
#SERVICE:4:4:9:3:0
#DESCRIPTION Shorthorn
#SERVICE:4:8:1:6:0
#DESCRIPTION Angus
#SERVICE:4:7:0:3:0:
#DESCRIPTION Ayrshire
#SERVICE:5:8:4:1:0
#DESCRIPTION Brown-Swiss
#SERVICE:3:6:7:1:0
#DESCRIPTION Galloway
#SERVICE:4:9:2:5:0
#DESCRIPTION Guernsey
#SERVICE:6:4:7:8:0
#DESCRIPTION Hereford
#SERVICE:2:7:4:1:0
#DESCRIPTION Holstein
#SERVICE:6:4:2:9:0
#DESCRIPTION Piedmontese
#SERVICE:3:6:3:1:0
#DESCRIPTION Scottish-Highland
#SERVICE:4:4:9:3:0
#DESCRIPTION Shorthorn
#SERVICE:4:8:1:6:0
#DESCRIPTION Angus
#SERVICE:4:7:0:3:0:
#DESCRIPTION Ayrshire
#SERVICE:5:8:4:1:0
#DESCRIPTION Brown-Swiss
#SERVICE:3:6:7:1:0
#DESCRIPTION Galloway
#SERVICE:4:9:2:5:0
#DESCRIPTION Guernsey
#SERVICE:6:4:7:8:0
#DESCRIPTION Hereford
#SERVICE:2:7:4:1:0
#DESCRIPTION Holstein
#SERVICE:6:4:2:9:0
#DESCRIPTION Piedmontese
#SERVICE:3:6:3:1:0
#DESCRIPTION Scottish-Highland
#SERVICE:4:4:9:3:0
#DESCRIPTION Shorthorn
#SERVICE:4:8:1:6:0
#DESCRIPTION Angus
#SERVICE:4:7:0:3:0:
#DESCRIPTION Ayrshire
#SERVICE:5:8:4:1:0
#DESCRIPTION Brown-Swiss
#SERVICE:3:6:7:1:0
#DESCRIPTION Galloway
#SERVICE:4:9:2:5:0
#DESCRIPTION Guernsey
#SERVICE:6:4:7:8:0
#DESCRIPTION Hereford
#SERVICE:2:7:4:1:0
#DESCRIPTION Holstein
#SERVICE:6:4:2:9:0
#DESCRIPTION Piedmontese
#SERVICE:3:6:3:1:0
#DESCRIPTION Scottish-Highland
#SERVICE:4:4:9:3:0
#DESCRIPTION Shorthorn
Now, just follow this road map :
Select any string #SERVICE
Run the Edit > Multi-select All > Match Case Only option
=> All strings #SERVICE should have been selected
Use the Shift + End shortcut to extend the selection to the end of each line
Use the Ctrl + X shortcut to delete these lines and place them in the clipboard
Hit two times on the Down arrow key
=> Each cursor/caret should had been moved two lines under
Use the Ctrl + V shortcut to recopy all #SERVICE lines to their new location
Finally, hit the ESC key to clear the current multi-selection
Voila !
Best Regards,
guy038
P.S. :
We could use the multi-selection of all #DESCRIPTION lines, either ! But, in that case, you need to :
Add an empty line at the very beginning of your file
Hit two times on the Up arrow key, right before the pasting operation
P.P.S. :
A similar regex S/R could be :
FIND (?-s)^(.+\R)(.+(\R)?)
REPLACE $2(?3:\r\n)$1
Note that the conditional replacement (?3:\r\n) manages the case where your last #DESCRIPTION line would not end with a line-break !