@copy_writes - Please check the below…in this case, you have to write group1 and group3 output with Spaces to get what you need…check this post on how to write group outputs
I agree with @Dave suggestion, because split and replace would be very easy to write in this case…