Hi Guys,
I have a file as follows. Here is my story:
For each field, the string in the 5th column needs to be searched in other fields of the same column and counted if the 1st column of the field is different from that of the primary field. BTW, the unique strings of 1st column need to be considered. Sorry if this is too complicated. Let me clarify it with this example. Here is my file (tab delimited):
A1 1 15231 15232 ESR1
A1 1 15235 15236 ESR1
A2 1 15231 15232 ESR1
A3 1 15235 15236 BTW
A4 1 15235 15236 FKH
A5 1 15235 15236 FKH
A6 1 15235 15236 FKH
Now the counts are reported in a new column:
A1 1 15231 15232 ESR1 2
A1 1 15235 15236 ESR1 2
A2 1 15231 15232 ESR1 2
A3 1 15235 15236 BTW 1
A4 1 15235 15236 FKH 3
A5 1 15235 15236 FKH 3
A6 1 15235 15236 FKH 3
Thanks a lot in advance!