I see you've already gotten a bunch of good suggestions, and here's another
suggestion from a different angle.
You could also turn on the "Strip trailing whitespace" option in the Text
Files preference panel, and save the document to apply this option before
processing its contents for duplicates, etc.
The advantage of this method is that once you've set that option, it will
continue to apply to all the files that you work with.
For reference, here's page 187 of the PDF manual:
====
Strip trailing whitespace
When this option is on, TextWrangler will trim all trailing non-vertical
whitespace from the document [] before writing it out.
You can also adjust this option on a per-language basis by adding custom
language preferences. (See "Languages Preferences" on page 182).
====
Regards,
Patrick Woolsey
==
Bare Bones Software, Inc. <
http://www.barebones.com/>