Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #15104

Re: files

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.glorb.com!newspump.sol.net!post2.nntp.sol.net!posts.news.twtelecom.net!nnrp3.twtelecom.net!not-for-mail
From Bob Hanlon <hanlonr357@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: files
Date Wed, 3 Jul 2013 08:46:40 +0000 (UTC)
Sender steve@smc.vnet.net
Approved Steven M. Christensen <steve@smc.vnet.net>, Moderator
Message-ID <kr0odg$3db$1@smc.vnet.net> (permalink)
References <20130702044702.A750C6A51@smc.vnet.net>
Lines 53
Organization Time-Warner Telecom
NNTP-Posting-Date 03 Jul 2013 08:48:40 GMT
NNTP-Posting-Host dd7bedb9.news.twtelecom.net
X-Trace DXC=`<_TKSo]RH>4c1ZETcjjP3C_A=>8kQj6=MOj3YM9`=a8<d7cidXOSm;EFiONJ7[Go6M\Q:B64hH^7
X-Complaints-To abuse@twtelecom.net
Xref csiph.com comp.soft-sys.math.mathematica:15104

Show key headers only | View raw


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 comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: files Bob Hanlon <hanlonr357@gmail.com> - 2013-07-03 08:46 +0000

csiph-web