Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #8393
| From | "Oleksandr Rasputinov" <oleksandr_rasputinov@ymail.com> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: importing series of file with the same extension |
| Date | 2012-02-08 10:31 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <jgtitr$6bm$1@smc.vnet.net> (permalink) |
| References | <jgqpfj$mts$1@smc.vnet.net> |
On Tue, 07 Feb 2012 09:04:51 -0000, maria giovanna dainotti
<mariagiovannadainotti@yahoo.it> wrote:
> Dear Mathematica group,
> I have defined the following code:
>
> grbs = {"80825593", "80916009", "81006604", "81024891", "81224887",
> "90217206", "90227772", "90323002", "90328401", "90510016",
> "90531775", "90626189", "90720710", "90902462", "90926181",
> "91003191", "91031500", "100116897", "100225115", "100325275",
> "100414097", "100620119", "100724029", "100728095", "100826957",
> "101014175", "101123952", "101204343", "110120666", "110328520",
> "110428388", "110529034", "110625881", "110709642", "110721200",
> "110731465"}
>
> grid = Table[grbs[[bb]], {bb, 1, Length[grbs]}]
> If[NumericQ[grid], GRBID = "0" <> ToString[grid], GRBID = grid]
>
> Data = Import[GRBID <> ".txt", "Table"]
>
> When I use this last command to import the data file not found during
> import.
>
This:
grid = Table[grbs[[bb]], {bb, 1, Length[grbs]}]
is equivalent to:
grid = grbs
And this:
If[NumericQ[grid], GRBID = "0" <> ToString[grid], GRBID = grid]
definitely does not accomplish anything useful either.
However, this should suffice:
data = Import["0" <> ToString[#] <> ".txt", "Table"]& /@ grbs;
Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread
importing series of file with the same extension maria giovanna dainotti <mariagiovannadainotti@yahoo.it> - 2012-02-07 09:04 +0000 Re: importing series of file with the same extension "Oleksandr Rasputinov" <oleksandr_rasputinov@ymail.com> - 2012-02-08 10:31 +0000
csiph-web