In the data given below (which is tab separated):
# data
1 xyz alfa x=abc;z=cbe;d=fed xt
2 xyz alfa y=cde;z=xy ft
3 xyb delta xy=def zf
I want to add a suffix _LT
in the elements (values of the variables) of 4th column after splitting at ;
.
Output like:
1 xyz alfa x=abc_LT;z=cbe_LT;d=fed_LT xt
2 xyz alfa y=cde_LT;z=xy_LT ft
I am able to add suffix at specific columns, but can't split(at delim)-add-merge.
awk -v PRE='_LT' '{$4=$4PRE; print}' OFS="\t" data.txt > data_LT.txt