From: Robert Keller Date: 2007-10-31T05:41:36+09:00 Subject: better way to accumulate totals --0-1087049805-1193776882=:5458 Content-Type: text/plain; charset=us-ascii I am just learning RUBY and am very impressed, I one week I've built tree routines that will save my group 6 to 7 hours each week, and they run in 2 minutes. Pretty cool. I would appreciate a suggest on how to do some. I have a script that correctly parses a directory full of text file and extracts key data. The data lines look like this: " category value" I have 15 categories and the code below works. But is crude. I create 15 global arrays and match each line "category" to the text trying in the case statement. Would hash or an object work better. Just looking for pointer of which way to direct my research. Thanks! Below is part of a big loop that goes through each found line for each document, and is in its own method. case top_event[0].lstrip.rstrip when "Redo size:" $redo_cnt[0] += 1 $redo_cnt[1] += top_event[1].to_f when "Logical reads:" $log_read_cnt[0] += 1 $log_read_cnt[1] += top_event[1].to_f ------------------------------ Robert rlkeller@yahoo.com --0-1087049805-1193776882=:5458--