Entering edit mode
4.0 years ago
S AR
▴
80
I have an array file having gene names and Fold change values. Its a three column file in which the gene column has semi colon separated values. I want to split those values but while splitting also want that the fold change is copied in the new line with the split values like below:
ID GENE FoldChange
TC0100007038.hg.1 NECAP2 1.17
TC0100007063.hg.1 FAM231C; FAM231A -1.04
TC0100007206.hg.1 CDA -1.15
TC0100007207.hg.1 PINK1; MIR6084 1.1
And I want the conversion to be like this:
ID GENE FoldChange
TC0100007038.hg.1 NECAP2 1.17
TC0100007063.hg.1 FAM231C -1.04
TC0100007063.hg.1 FAM231A -1.04
TC0100007206.hg.1 CDA -1.15
TC0100007207.hg.1 PINK1 1.1
TC0100007207.hg.1 MIR6084 1.1
I used awk to split the semi colon separated values into rows but unable to copy the next column value in the split line. Can anyone help please?
Thanks that is great it worked:)