Re: files
- To: mathgroup at smc.vnet.net
- Subject: [mg131389] Re: files
- From: Bob Hanlon <hanlonr357 at gmail.com>
- Date: Wed, 3 Jul 2013 04:56:05 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- Delivered-to: l-mathgroup@wolfram.com
- Delivered-to: mathgroup-outx@smc.vnet.net
- Delivered-to: mathgroup-newsendx@smc.vnet.net
- References: <20130702044702.A750C6A51@smc.vnet.net>
Export[#, "Contents of file " <> #] & /@
{"a.txt", "b.txt",
"5673ANTIOQUIA.txt", "nuevoANTIOQUIA.txt", "ANTIOQUIAcomplejo.txt"};
files = Select[FileNames[], ! StringFreeQ[#, "ANTIOQUIA"] &];
fileContents = Import /@ files;
Thread[{files, fileContents}]
{{"5673ANTIOQUIA.txt",
"Contents of file 5673ANTIOQUIA.txt"}, {"ANTIOQUIAcomplejo.txt",
"Contents of file ANTIOQUIAcomplejo.txt"}, {"nuevoANTIOQUIA.txt",
"Contents of file nuevoANTIOQUIA.txt"}}
Bob Hanlon
On Tue, Jul 2, 2013 at 12:47 AM, Francisco Gutierrez <fgutiers2002 at yahoo.com
> wrote:
>
> Dear Group:
> Suppose that I choose a directory:
>
> SetDirectory["S:\\mydirectory"]
>
> And in that directory I have a set of files, each of which contains the
> string "ANTIOQUIA". For example "5673ANTIOQUIA.txt", "nuevoANTIOQUIA.txt",
> "ANTIOQUIAcomplejo.txt"
>
> I already have managed to find the files automatically.
> Now, my two questions:
>
> a. Is there a way to open them authomatically from Mathematica?
> b. Even better, to find them and import them into Mathematica?
>
> Thanks and best regards
>
> Francisco
>
>
- References:
- files
- From: Francisco Gutierrez <fgutiers2002@yahoo.com>
- files