parse_csv.rb
# Reads in the CSV file line by line and
# - Prints the seperated contents of the line
# - Compares elements to find the maximum number values in the file
# - Returns the maximum column values in an array
Reads in the CSV file line by line and
Prints the seperated contents of the line
Compares elements to find the maximum number values in the file
Returns the maximum column values in an array
Reads in the CSV file line by line and Prints the seperated contents of the line Compares elements to find the maximum number values in the file Returns the maximum column values in an array
def parse_file()
    max_vals = Array.new(@@titles.length)
    f = File.open(@filename, "r")
    f.gets
    line_num = 1
    f.each_line { |line|
      line = line.rstrip!
      line_array = line.split(/,/)
      check_max_values(line_array, line_num)
      line_num += 1
    }
    return @max_vals
  end
def parse_file ( ) max_vals = Array . new ( @@titles . length ) f = File . open ( @filename , "r" ) f . gets line_num = 1 f . each_line { | line | line = line . rstrip! line_array = line . split ( / , / ) check_max_values ( line_array , line_num ) line_num += 1 } return @max_vals end
Reads in the CSV file line by line and
 Prints the seperated contents of the line
 Compares elements to find the maximum number values in the file
 Returns the maximum column values in an array
Reads in the CSV file line by line and Prints the seperated contents of the line Compares elements to find the maximum number values in the file Returns the maximum column values in an array
#Format line, print information and check against the max vals