from openpyxl import load_workbook

filePathRunProperties = "${runInfo}"
filePathIn = ""

# Optional file to write variables to, for debugging purposes
filePathExtra = "C:/Users/Steve/Desktop/scrap.tsv"
fileExtra = open(filePathExtra, "a")

# Read the runProperties.tsv file for the file paths of the data file we read from, and the one we will write to.
fileRunProperties = open(filePathRunProperties, "r")
for l in fileRunProperties:
    row = l.split()
    if row[0] == "runDataUploadedFile":
        filePathIn = row[1]
fileRunProperties.close()

# Parse excel file using openpyxl
wb = load_workbook(filename = filePathIn)
sheet_obj = wb.active

# Show the data object we're working with
for row in list(sheet_obj.iter_rows())[0:]:
    row = [cell.value for cell in row]
    fileExtra.write(str(row) + "\n")

fileExtra.close()
