How to remove duplicate lines in a text document or list.


I had a list of email addresses but some of them were duplicates that I wanted to remove. My first port of call was Apple Numbers but it was too complicated. I had to sort them, then write a function to detect duplicates, then filter the results.

Good old textwrangler can do it in one go. Here’s how.


1. Past the list into Textwrangler.  (Textwrangler is the free version of BBedit. It’s a great little text editor that can do all kinds of tricks.  You can download it here.)

2. Select ‘Text: Process Duplicate Lines’


Make sure ‘Delete Duplicate Lines is selected in the next dialog box, then hit ‘Process’ and all the duplicate lines will be removed!


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.