Started to implement a script for comparison

Signed-off-by: 's avatarHenrique Varella Ehrenfried <hve13@inf.ufpr.br>
parent 6a8687fc
# ARGV[0] = Caminho do arquivo
@all_lines = Array.new
all_lines = Array.new
results = Array.new
ARGV[0] = file_analyze
ARGV[1] = source_matrix
File.readlines(ARGV[0]).each do |line|
File.readlines(file_analyze).each do |line|
all_lines << line
end
......@@ -10,3 +13,15 @@ end
# Index 101~200 = 20%
# Index 201~300 = 50%
matrix = CSV.new(source_matrix,{:col_sep => ";"}).to_a
matrix_t = matrix.transpose
matriz_size = matrix.size
all_lines.each do |a|
sum_array = Array.new
temp_a = a.split(" ")
temp_a.each do |ta|
index = matrix[0].index(ta)
sum = matrix_t[index].map{|x| x.to_i}.reduce(&:+)
sum_array << sum
end
end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment