One solution using a while loop and tput
:
while IFS=$'\t' read -r c1 c2 c3; do
tput setaf 1; printf "$c1\t"
tput setaf 2; printf "$c2\t"
tput setaf 3; printf "$c3\t"
tput sgr0; echo
done < file
AnotherA solution using printf
to format the ouput as well :
while IFS=$'\t' read -r c1 c2 c3; do
tput setaf 1; printf '%-10s' "$c1"
tput setaf 2; printf '%-30s' "$c2"
tput setaf 3; printf '%-30s' "$c3"
tput sgr0; echo
done < file