Created
March 5, 2011 00:31
-
-
Save taylor/855968 to your computer and use it in GitHub Desktop.
calculate total minutes and hours used for calling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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