Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: Drop all that are listed in an external file
From
miriam geringer <[email protected]>
To
[email protected]
Subject
st: Drop all that are listed in an external file
Date
Sat, 25 Jan 2014 16:50:36 +0100
Hi Statalist,
I have the following dataset:
Identifier Corresponding data
1 X
2 Z
3 D
4
4
4
5
5
5
5
6
6
6
7
8
On the other hand, I have a *txt file, which includes only identifiers
that should be dropped from my dataset. A simple *txt including for
example:
Identifier
2
3
4
Now, I want Stata to access this *txt file and drop all the
observations in the dataset (based on the Identifier) that are in this
specific *txt file. I know that I could just copy it into Stata, but
since the list is very long I would prefer an "external" link to this
file.
After dropping, it should look like:
Identifier Corresponding data
1 X
5
5
5
5
6
6
6
7
8
Is something like this possible?
Something like:
drop if identifier exists using C:/*txt
Thanks!
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/