Created
December 3, 2010 03:15
-
-
Save chischaschos/726532 to your computer and use it in GitHub Desktop.
rubyc example data
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
headers = nil | |
rows = [] | |
File.open(ARGV[0] || 'data.csv', 'r') do |file| | |
headers = file.gets.split(',') | |
while(line = file.gets) do | |
cols = line.split(',') | |
rows << cols | |
end | |
end | |
puts "Tu csv tiene #{headers.size} columnas " | |
puts "Tu csv tiene #{rows.size} renglones " | |
# Imprime la ultima columna del primer elemento | |
puts rows[0].last | |
puts "-"*20 | |
rows.each do |element| | |
puts "Las fechas son #{element[0]}" | |
end | |
puts "-"*20 | |
count = 0 | |
rows.each do |element| | |
element[2].gsub!(/^\s/, '') | |
count += 1 if element[2].chomp == 'Pepe Juarez' | |
end | |
puts "Contador = #{count}" |
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
Date | Team member | Was I able to fulfill what I committed to? | What am I comfortable committing to today? | What is obstructing me in meeting my commitments? | |
---|---|---|---|---|---|
September 13, 2010 | Pepe Juarez | No | Complete task # 34 | learn ruby | |
October 20, 2010 | Pepe Juarez | Yes | Complete task # 65 | A new issue arose on XYZ module |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment