Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Removing Repeated Phrases in String Variable

From   Becker Stein <>
Subject   st: Removing Repeated Phrases in String Variable
Date   Sat, 14 Dec 2013 16:26:51 -0500 (EST)


I was wondering if someone could help me remove repeated words/phrases in a string variable. My data has a lot repeats and I only want to keep the first instance of an item. Below is an example.

BMW North America; Honda; Toyota; Nissan; BMW North America; Mercedes Benz North America; Nissan; Subaru; Nissan; Ford

In the above example, I'd like to get rid of the extra instances of BMW North America and Nissan. Is there a way to do this? Thanks in advance for your help.


*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index