[R] select .txt from .txt in a directory

Sarah Goslee sarah.goslee at gmail.com
Fri Nov 8 18:40:46 CET 2013

How do you decide which ones you need?

Is there some pattern that lets you distinguish needing df.txt from
not needing ds.txt?

You say you "have the names" - how do you have them? In a text file?

What are you trying to do with the text files?


On Fri, Nov 8, 2013 at 12:33 PM, Zilefac Elvis <zilefacelvis at yahoo.com> wrote:
> Hi,
> I have 300 .txt files in a directory. Out of this 300, I need just 100 of the files.
> I have the names of the 100 .txt files which are also found in the 300 .txt files.
> How can I extract only the 100 .txt files from the 300 ,txt files?
> e.g given d1.txt, ds.txt, dx.txt, df.txt...d300.txt, how can I select only d1.txt and df.txt? Remember, I have 300 of such and want to extract 100 of them with names known.
> Thanks for your great help.
> Atem.

Sarah Goslee

More information about the R-help mailing list