MathGroup Archive 2001

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

Search the Archive

Re: FileName and Shell Command

  • To: mathgroup at smc.vnet.net
  • Subject: [mg30988] Re: FileName and Shell Command
  • From: "Albert Retey" <albert.retey at visualanalysis.com>
  • Date: Sat, 29 Sep 2001 04:19:08 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

franc wrote:
>
> Hello !
>
> I have a problem to copy data in files
>
> my program is :
>
> 1            For[j=1,j<4,j++,
> 2                  {franc={};
> 3                  For[i=1,i<10,i++,
> 4                 {franc=Append[franc,j*i]
> 5                   };
> 6                     ] };
> 7                    ]
>
> So i would like to save franc in a external file : franc1.data,
> franc2.data, franc3.data
>
> Th command i use is :
>
> franc>>franc.data
> Run["cp franc.data franc$j.data"]
> (after line 6)
>
> But mathematica ignore the $i and just save franc.data so i only keep
> the last calculated (for j=3)
>
> SO if you have a key to solve my pb, PLEASE help.
>
> Thank you !!!!!!

Sorry, my last answer was missing a ToString:

Run["cp franc.data franc$"<>ToString[j]<>".data"]

You might also want to save it to that name in the first place, instead
of copying. You can StringJoin right away and use the resulting string
directly in Put[] (>> is just a shortcut for Put):

Put[franc,"franc$"<>ToString[j]<>".data"]

Albert


  • Prev by Date: Mathematica for Statistics?
  • Next by Date: Re: Help! FindRoot output to list...
  • Previous by thread: Re: FileName and Shell Command
  • Next by thread: How To Prove The Validity Of Dividend Discount H Model