Skip to content

Instantly share code, notes, and snippets.

@taylor
Created March 5, 2011 00:31
Show Gist options
  • Select an option

  • Save taylor/855968 to your computer and use it in GitHub Desktop.

Select an option

Save taylor/855968 to your computer and use it in GitHub Desktop.
calculate total minutes and hours used for calling
ruby -e 'require "rubygems"; \
begin; \
require "fastercsv"; \
myCSV=FasterCSV; \
rescue LoadError; \
require 'csv'; \
myCSV=CSV; \
end; \
s=0;
myCSV.foreach(ARGV[0]) do |r| \
s = s + r[13].to_i;
end ; \
m = s / 60; \
h = m / 60; \
puts "Minutes: #{m}, Hours: #{h}"' \
Master.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment