Hi I have a source file that looks like
a,b,c,d,e,f,g,h,t,DISTI(USD),MSRP(USD),DIST(EUR),MSRP(EUR),EMEA-DISTI(USD),EMEA-MSRP(USD),GLOBAl-DISTI(USD),GLOBAL-MSRP(USD),DISTI(GBP), MSRP(GBP)
I want to basically change MSRP(USD) to MSRP,USD and DIST(EUR) to DIST,EUR and likewise for all i'm using the following command and able to replace "(" with , but not sure if i can use multiple replace inside gsub.
awk 'NR==1{for(i=10;i<=NF;i++){gsub(/\(/,OFS,$i);A=$i}; print $A}' OFS=',' FS=',' sample.txt
Thanks