Hello everyone,

Let me preface that I am completely new to Stata. My problem is the following and I can't find a solution with google, so I hope you can help me

I have one Dataset that looks like the following:

ID // Name // Value // ...(more variables)

1 xyz 100
2 abc 120
...

(about 4 million rows)


The thing is I don't need all the rows only about 5000 of them and I have an Excel sheet with the IDs that I actually need. It is just one Column, like:

ID
1
2
3
...

I tried to export the dataset to excel and do it there, but it has too many rows for excel, so is there a way to get rid of the rows with IDs that are not in the Excel and keep the rest?

Thank you very much!