require ‘rubygems’
require ‘ruport’
require ‘ruport/util’
require ‘date’
require ‘optparse’
opts = OptionParser.new do |opts|
opts.on("-h", “–help”, “Displays this help.”) do |a|
puts opts
end
opts.on("-s", “–startdate”, “Determines what start date to use.”) do
|b|
@startdate = Date.new(*ParseDate.parsedate(i)[0,3])
end
opts.on("-e", “–enddate”, “Determines what end date to use.”) do |c|
@enddate = Date.new(*ParseDate.parsedate(i)[0,3])
end
#######
so the main line i want to focus on is
@startdate = Date.new(*ParseDate.parsedate(i)[0,3])
So ive grep’d the data out of the csv based on name. and along with
these names comes the dates and the data.
How would i go about making that @startdate match up with the grep data
so that it
- greps only those inputed dates for each name
- how would i average the data for each date say if the column name
were Number…IE:
Date Number Name
4/23/07 1.43 Blah1
and if that date of 4/23 had multiple numbers in the Number column how
would i average out all the numbers and have the average tied to that
date?
Thanks again!