       Help on iteration

• To: mathgroup at smc.vnet.net
• Subject: [mg54942] Help on iteration
• From: Clifford Martin <camartin at snet.net>
• Date: Mon, 7 Mar 2005 02:10:26 -0500 (EST)
• Sender: owner-wri-mathgroup at wolfram.com

```I've got a simple problem I can't seem to get right.
Here is a sample set of data

glist={{a,b,c,d,e,f,g,h,l,m,n,o,p,q,Date1},
{a,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,Date2},
{a,R,s,t,u,v,X,Y,z,aa,bbb,cc,dd,tt,Date3}};

What I want to do is look at the 14th element in each
sublist. (For example in the above example data that
would be values q, Q and tt). If any value is equal to
zero (in my example lets say that tt =0) I want to
1.Check the date.
2.Pull a value associated with that date ,lets call
it zzz. (that I've entered somewhere else and made a
variable).
3. Calculate a new value for tt (non zero) using a
calculation such as (s-C)+zzz.
4. Replace the value of tt(that was zero) with the
new calculated value.
5. I want to do this for every list in my data set.

My actual case is a bit more complicated than this
but if I can see how to do something like this I can
probably figure out my problem. Thanks for any help.

Cliff

```

• Prev by Date: Re: Bug in Import?
• Next by Date: Re: Kernel Problem
• Previous by thread: Re: Outputing a tabular function
• Next by thread: Re: Help on iteration