#!/usr/bin/python3

# See https://stackabuse.com/read-a-file-line-by-line-in-python/
# for more information
# Just try reading it line by line on the first attempt.
try:
    inFile = open("dogs.csv",'r')

    count = 1
    line = inFile.readline()
    line = line.rstrip("\n")
# process header
    columnNames = line.split(",")
    print(columnNames)
    while(line):  # Read line and place in variable named line
#        print(count,line.rstrip("\n"))
        print(count,line)
        columns = line.split(",")
#        print(columns)
        counter = 0
        while(counter < 4):
            print("\t{:12s} {:>20s}".format(columnNames[counter],columns[counter]) )
            counter = counter + 1
        line = inFile.readline()
        line = line.rstrip("\n")
        count = count + 1

finally:
    inFile.close()
