Post Reply 
Summing lists in directory structure
09-14-2017, 11:17 AM
Post: #1
Summing lists in directory structure
This one's caused me to scratch my head a bit, to be honest. I wanted to total up the amount we've spent on groceries (so far), so I took each day's amounts and put them all into named lists, like this: { 234.56 12.98 3.99 } 'JUN25' STO

Each month gets its own folder, i.e. JAN FEB MAR, APR ... OCTOB NOV DECEM.

When I want to add up the individual lists, I simply recall them one at a time, hit + between each one after the second one, and use ΣLIST when I have the final big list. I created a very short program thus:
Code:
\<< + ΣLIST 'TOTAL' STO
\>>
and stored it in each month's folder (yes, I know it's inefficient to all get go). I then run that program in each folder.
I have a folder structure that looks something like this:
Code:

GROCERIES
  JAN
    TOTAL MONTOT JAN11 JAN25
  FEB
    TOTAL MONTOT FEB8 FEB22
  ...
  OCTOB
  NOV
  DECEM

Now I'm wondering how to add together all the TOTALs in each folder to give me a sum at the end? Or better still, how would I use a better program than the one I cobbled together from perusing the User's Guide's List section? I'm sure that if I could run a program in the GROCERIES folder iterating over each month, I could gather the relevant variables together, sum them all, and give myself a total (I did this manually by adding together all the TOTALs) using the program instead.

Let me know if you need any further details, as I may not have explained myself very well.

Cheers, brickviking

(Post 82)

Regards, BrickViking
HP-50g |Casio fx-9750G+ |Casio fx-9750GII (SH4a)
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Summing lists in directory structure - brickviking - 09-14-2017 11:17 AM



User(s) browsing this thread: 1 Guest(s)