Clean certain files of trailing whitespace

The command used to find the whitespace :-

awk '{t=length($0);sub(" *$","");print NR":"t-length($0)}' file | grep [^0]$

Only the files with the fewest lines in need of attention
were cleaned.