awk
to the rescue!
assuming your file1 has one more column than file2 and you're diffing corresponding columns from file1 and file2
$ paste file1 file2 |
awk '{n=int(NF/2); printf "%s", $1;
for(i=2;i<=n+1;i++) printf "%d" ,OFS ($i-$(i+n)); printf "\n"}'
it also implicitly assumes total number of fields are odd.
with dummy data
create 100 column file; append row headers to one of them. Since the data portions are equal, all diffs are expected to be zero.
$ seq 200 | xargs -n 100 > file2
$ paste <(echo -e "row1\nrow2") file2 > file1
$ paste file1 file2 | awk ...
row1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
row2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0