I have two files as below. I want to search for every item in every column in the f1 and see it if exists inside column 3 of the f2 file (for each column of f1 separately). If any exists then write the related
chr of that item from the
chr column of f2 (the first column of f2).
gene_symbol,lncRNA_symbol kctd,Malat1 Gas5,Snhg6
chr,gene_type,gene_symbol chr7,snRNA,Gas5 chr1,protein_coding,Malat1 chr2,TEC,Snhg6 chr1,TEC,kctd
So based on the two files mentioned the desired output should be:
gene_symbol,lncRNA_symbol,gene_chr,lncRNA_chr kctd,Malat1,chr1,chr1 Gas5,Snhg6,chr7,chr2
I do not have a strong programming background and found this very complex - Even though I have checked multiple sources but have not been able to develop a solution - any help is appreciated. Thanks