Skip to content

Instantly share code, notes, and snippets.

@l3kn
Created January 31, 2013 16:44
Show Gist options
  • Save l3kn/4684238 to your computer and use it in GitHub Desktop.
Save l3kn/4684238 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'csv'
class Value
attr_accessor :name, :min , :max
def initialize(name, min = 0, max = 0)
@name = name
@min = min
@max = max
end
end
Dir.chdir "/Volumes/Arduino"
config = CSV.read('LOG00.csv')
names =
vals = Array.new
config.first.each do |name|
value = Value.new(name)
vals.push(value)
end
config.each do |row|
for i in 0..(row.count-1) do
if row[i].to_i > vals[i].max.to_i
max[i] = row[i]
end
if row[i].to_i < min[i].to_i
min[i] = row[i]
end
end
end
puts names
puts max
puts min
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment