Skip to main content
3 of 5
added 45 characters in body
αғsнιη
  • 41.9k
  • 17
  • 75
  • 118

Try:

awk 'BEGIN { FS=OFS="\t" } NR==FNR { seq=$1; sub(/^[^\t]*\t*/,""); if(NR==1)hdr=$0; hold[seq]=$0; next } FNR==1 { print $0, hdr; next } ($1 in hold) { print $0, hold[$1]; next } { print }' fileB fileA 
αғsнιη
  • 41.9k
  • 17
  • 75
  • 118