I have a tsv
file with tab-separated columns. I want to obtain the 5th column, which has space-separated values. Convert the space-separation to tab-separation and save as a new file.
Attempt:
cut -d"\t" -f"4" input.tsv
awk -v OFS="\t" '$1=$1' input.tsv > output.tsv
Input:
Composite_Element_REF Gene_Symbol Chromosome Genomic_Coordinate TCGA-KL-8323-01A-21D-2312-05 TCGA-KL-8324-01A-11D-2312-05 TCGA-KL-8325-01A-11D-2312-05
cg00000027 RBL0 14 53468110 0.0545368833399913 0.635089208882213 0.0581022991274144
cg00000028 RBL1 15 53468111 0.0545366588241415 0.635089205024173 0.0581085373336217
cg00000029 RBL2 16 53468112 0.0545366588040571 0.635089205078394 0.0581085373332275
Expected output:
Composite_Element_REF TCGA-KL-8323-01A-21D-2312-05 TCGA-KL-8324-01A-11D-2312-05 TCGA-KL-8325-01A-11D-2312-05
cg00000027 0.0545368833399913 0.635089208882213 0.0581022991274144
cg00000028 0.0545366588241415 0.635089205024173 0.0581085373336217
cg00000029 0.0545366588040571 0.635089205078394 0.0581085373332275