hopefully my last range date question

  • Thread starter Michael Linfield
  • Start date
M

Michael Linfield

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
1. greps only those inputed dates for each name
2. 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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top