MathGroup Archive 2007

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

Search the Archive

Re: how to save each raw of data to separate file?


Hi Arek,

the problem is with ">>" -- this operator converts the right hand side
to a string, so Table will not replace it with a value.
So what happens is that b[[1]] is written to the file "i", than b[[2]]
overwriting it and finally b[[3]] overwriting it.

What You can do is this:

Table[ Put[ b[[i]], ToString[i] ], { i, 1, Length[b] } ]

Regards,

Peter

On 17 Aug., 08:04, Arkadiusz.Ma... at gmail.com wrote:
> Hi,
>
> Say I have a list of sublists
> b= {{a1,a2,a3},{b1,b2},{c1,c2,c3,c4}}
>
> How can I automatically save b[[1]], b[[2]] and b[[3]] to three
> separate files?
>
> How should I correct the below expression to let it work?
>
> Table[b[[i]]>>i, {i,1,Length[b]}]
>
> Thanks,
>
> Arek





  • Prev by Date: Re: Mathematica 6
  • Next by Date: Re: Graphics output in Mathematica 6 functions ?
  • Previous by thread: Re: how to save each raw of data to separate file?
  • Next by thread: Re: how to save each raw of data to separate file?