I have a problem, please could you help me? I have the .txt file I use the awk code to separate columns using the tab delimited function. I receive the align columns, but if some information missing, the whole row turn left and information are shifted to another column. Please could you help me? How could I incorporate to this code? Thank you so much..
#!/bin/bash
for f
in *.vcf;
do awk 'BEGIN {OFS = "\t"}
/^##/ {next}
/^#/ {sub(/^#/,"",$1)}
{$1=$1; print}
' "$f" > "${f/%vcf/tsv}"
done
> INPUT:
>
> CHROM ID REF ALT
chr1 235 A B
chr2 A B
chr3 225 B
OUTPUT:
CHROM ID REF ALT
chr1 235 A B
chr2 . A B
chr3 225 . B