I want to have exactly the same output in this post(Extract data in linux/unix above,but I have a new input file,which is below:
ABCB11 4 ACE 11
ABCB11 4 CHRM1 114
ABCB11 4 CHRM2 115
ABCB11 4 DRD2 158
ABCB11 4 EGF 164
ABCC8 5 ACE 11
ABCC8 5 ADRA1A 21
ABCC8 5 ADRA1B 22
ABCC8 5 ADRA1D 23
ABCC8 5 CHRM1 114
Taking all the unique genes and creating the output.
I want all rows to have fromid,after taking distinct values from both. The exact output is what I want below:
ABCB11 = fromid=4,from=ABCB11
ABCC8 = fromid=5,from=ABCC8
ACE = fromid=11,from=ACE
CHRM1 = fromid=114,from=CHRM1
CHRM2 = fromid=115,from=CHRM2
DRD2 = fromid=158,from=DRD2
EGF = fromid=164,from=EGF
ADRA1A = fromid=21,from=ADRA1A
ADRA1B = fromid=22,from=ADRA1B
ADRA1D = fromid=23,from=ADRA1D