MathGroup Archive 2008

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

Search the Archive

RE: Re: Executing external notebook

  • To: mathgroup at
  • Subject: [mg92780] RE: [mg92764] Re: Executing external notebook
  • From: "Tugrul Temel" <temelt at>
  • Date: Mon, 13 Oct 2008 06:18:13 -0400 (EDT)
  • References: <gcq09i$c30$> <>

Dear Peter,

I tried to follow your suggestion below to bring an ".m" file into a
notebook and run it using the data within the current notebook.

I set the current directory to where my data, nb and .m files are. 
SetDirectory["directory where ".nb" and ".m" files saved"] 

I call "CommonProgram.m" into the notebook (nb) by Get["CommonProgram`"].
The notebook already has data in it.

I just want to run "CommonProgram.m" to get results using the data in the
".nb". No error message comes out but neither the results.

What is wrong here?


-----Original Message-----
From: Peter Pein [mailto:petsie at] 
Sent: Sunday, October 12, 2008 10:35 AM
To: mathgroup at
Subject: [mg92780] [mg92764] Re: Executing external notebook

change all input cells in common.nb to initialisation cells, save common.nb
and chose in the appearing box to create an autosave package. this will
generate a file common.m in the same folder as the common.nb is located in.
Then you can use <<"/path/to/common" in your main[1-5].nb (of course you
to replace the "/path/to" part by the actual path to your common file).


pdingle at schrieb:
> I have a really trivial question, but nevertheless am stuck.
> Within a notebook file, how do I execute an external notebook and keep
> all the results in memory?
> For example I have 5 files,
> main1.nb
> main2.nb
> main3.nb
> main4.nb
> main5.nb
> each of which must call
> common.nb
> which contains code that is common to all 5 main files.
> It seems like this should be easy to do but I cannot find an
> appropriate command (Get seems like it is intended for this purpose,
> but perhaps I am not using it correctly).

  • Prev by Date: Re: Getting rid of those deprecated Do[] loops?
  • Next by Date: Re:mathematica and CGT
  • Previous by thread: Re: Easiest Mathematica algorhitm needed
  • Next by thread: Re: Easiest Mathematica algorhitm needed