parse_csv.rb
# Compares the elements in the current line against the current
# maximum, then updates the max_vals array and returns it
Compares the elements in the current line against the current
maximum, then updates the max_vals array and returns it
Compares the elements in the current line against the current maximum then updates the max_vals array and returns it
def check_max_values(line_array, line_num)
    line_array.each_with_index { |col, index|
      if index >= @max_vals.length; return @max_vals; end
      if !(col.nil?) && col.is_number?
        col = to_numeric(col)
        if @max_vals[index].nil?
          @max_vals[index] = col
        elsif col > to_numeric(@max_vals[index])
          @max_vals[index] = col
        end
      end
    }
  end
def check_max_values ( line_array , line_num ) line_array . each_with_index { | col , index | if index >= @max_vals . length ; return @max_vals ; end if ! ( col . nil? ) && col . is_number? col = to_numeric ( col ) if @max_vals [ index ] . nil? @max_vals [ index ] = col elsif col > to_numeric ( @max_vals [ index ] ) @max_vals [ index ] = col end end } end
Compares the elements in the current line against the current
maximum, then updates the max_vals array and returns it
Compares the elements in the current line against the current maximum then updates the max_vals array and returns it
line_array
<not_specific>
line_num
<not_specific>