Usando awk
:
awk '
NR==1 {
for (i=1; i<=NF; i++)
header[i] = $i
}
NR==FNR {
for (i=1; i<=NF; i++) {
A[i,NR] = $i
}
next
}
{
for (i=1; i<=NF; i++)
if (A[i,FNR] != $i)
print "ID#-" $1 ": " header[i] "- " ARGV[1] " value= ", A[i,FNR]" / " ARGV[2] " value= "$i
}' file1.txt file2.txt
Saída:
ID#-ee: Time- file1.txt value= gg / file2.txt value= 2g
ID#-ii: Building- file1.txt value= ll / file2.txt value= 2l