Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: importing series of file with the same extension

  • To: mathgroup at smc.vnet.net
  • Subject: [mg124816] Re: importing series of file with the same extension
  • From: "Oleksandr Rasputinov" <oleksandr_rasputinov at ymail.com>
  • Date: Wed, 8 Feb 2012 05:29:25 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <jgqpfj$mts$1@smc.vnet.net>

On Tue, 07 Feb 2012 09:04:51 -0000, maria giovanna dainotti  
<mariagiovannadainotti at 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;



  • Prev by Date: Re: Mathematica 8 - kernel hangs
  • Next by Date: Re: Why does the order of down values come back?
  • Previous by thread: Re: importing series of file with the same extension
  • Next by thread: Insets don't line up properly with Axes?