I recently had to find out whether a very large text file had any lines where the length (character count) of each line differed, as they needed to be identical. This will help:
cat file.txt | awk '{gsub(/[ \t]+$/,""); print length($0)}' | sort -u