Credit to a great many entries from you online and manuals.It works, but, is it efficient enough?Do you approve?{Reading logs +- 5k items fast as I can see}  Source data from file myAwk3.txt: type,Srv-1,2016-04-16 23:59:02,Name1,1234567890abcdef123456789bbbbb00,(10.90.178.4:1004)type,Srv-1,2016-04-16 23:59:24,<N@me> (-) [==]1 23,1234567890abcdef123456789bbbbb22,(192.10.196.74:65005)Code that works now:awk --re-interval -F, 'BEGIN{OFS=,;}{ patPort=:[0-9]{1,5};              # Will find :1 to :65xxxIpPort=$6                           # Field needed, (192.10.196.74:65005)IpOnly=gensub(patPort, ,1,$6);    # Remove patternIpOnly=gensub(/[(]/, ,1,IpOnly);  # Remove ( , With sed: sed 's/[()]//g' IpOnly=gensub(/[)]/, ,1,IpOnly);  # Remove )print IpPort, IpOnly;               # Show old and new data} ' myAwk3.txtResult:(10.90.178.4:1004),10.90.178.4(192.10.196.74:65005),192.10.196.74
AWK interval expressions to clean IP
text processing;awk;sed
I suggest to eliminate the regex match and substitution overhead:awk '    BEGIN { FS = OFS = , }    {         split($6, a, :);        print substr(a[1], 2);    }' myAwk3.txt