I need some help with a script that would find certain word in a line (-port@) , then replace all spaces after that line with commas until it encounters a number followed by a dot, semi-colons or end of line.
I am using " " as field separators.
So, for example
textextext 0.0.0.0 -port@1 20 300 4000 50000 ; 0.0.0.0 -port@6 70 800
line would appear
textextext 0.0.0.0 -port@1,20,300,4000,50000 ; 0.0.0.0 -port@6,70,800
I'd prefer it done using gawk rather then sed, but sed script would be welcome too.
Cheers and thanks for your time,