Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #15104 > unrolled thread
| Started by | Bob Hanlon <hanlonr357@gmail.com> |
|---|---|
| First post | 2013-07-03 08:46 +0000 |
| Last post | 2013-07-03 08:46 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: files Bob Hanlon <hanlonr357@gmail.com> - 2013-07-03 08:46 +0000
| From | Bob Hanlon <hanlonr357@gmail.com> |
|---|---|
| Date | 2013-07-03 08:46 +0000 |
| Subject | Re: files |
| Message-ID | <kr0odg$3db$1@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@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
>
>
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web