Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: Batch

  • To: mathgroup at smc.vnet.net
  • Subject: [mg60421] Re: Batch
  • From: Torsten Coym <torsten.coym at eas.iis.fraunhofer.de>
  • Date: Fri, 16 Sep 2005 03:49:00 -0400 (EDT)
  • Organization: Fraunhofer Gesellschaft (http://www.fraunhofer.de/)
  • References: <200509131007.GAA09833@smc.vnet.net> <dg8l4h$r21$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Maria,

I see your point here. I came across the very same problem during my
last project. Besides, I copied the routine into several cells, each
enclosed with With[] statement, where I set some constants - which was
in fact the only difference between the routines...
Since I had to process files,that eventually generated other files as
their output, I wrote a function processFile[file_String] that did that
for one file and then used  FileNames[] to create a list conatining all
files to be processed. I mapped processFile[] over that list, like:

processFile[name_String] := Module[{N, n, M, q, p,str},
p = 1; {N, n, M} = ToExpression /@ Take[StringSplit[name,
        {"N", "n", "M", "."}], 3];
str = StringSplit[Import[name, "Text"]];
q = ToExpression[str[[2]]];
 ]

processFile/@FileNames["*.dat"]

or something like that.

Hope that helps, although its not quite the same as what you're actually
looking for.

Torsten

Maria Cristina Dias Tavares wrote:
> Hi,
> 
>     I need to run a batch in Mathematica, so that I read data from 
> several files and execute the calculations and generate the graphics. 
> Then I read another group of data and perform the same calculation and 
> that goes on until the data finish.
> 
>     I just manage to do this by putting all the calculation in a single 
> cell, inside a Do. My cases are rather large, I am dealing with 
> experimental data and I have to manipulate files with 1,000,000 points. 
> I cannot just read all of them at once and start the calculus.
> 
>     My first go was to separate the calculations in notebooks and one nb 
> called the next one. The first notebook called the following without a 
> problem, but it did not evaluate it. I had to do it manually. And I have 
> around 100 cases to analyse. I really need to automatize the procedure.
> 
>     Thanks all.
> 


  • Prev by Date: Re: Mathematica can't solve simple system of equations
  • Next by Date: Complete solution to a modular System of equations
  • Previous by thread: Re: Batch
  • Next by thread: Re: operators for relations in sets