BEGIN { FS=OFS="\t" } NR==1 { print "sample_id","group","value"; next } $4=="used" { print $1,$2,$3 }