I have a file that has hundreds of lines and each line has a set of characters with the delimiter ~ like below.
T01~T02~T03~T04~T05~T06~T07~T08~T09~T10~T11~~T13
.
.
.
.
I need to remove T02,T11 and T12 using awk. If you see the above string the T12 is null but still i need to empty that position and my output should look like :
T01~T03~T04~T05~T06~T07~T08~T09~T13
I have tried the following awk command
awk -F~ '{$2=$11=$12="";print $0}'
but it's giving the output like
T01 T02 T03 T04 T05 T06 T07 T08 T09 T10 T11  T13
Can anyone please let me know if I missed anything..



cut -d~ -f 1,3-9,13