there are xls files saved in a folder and all of them have have values in the 1st, 2nd, and 3rd columns. in the folder there are about 100 excel files, the first five number of excel file names represent the patient id.there are about 5 to 10 excels for a single patient, which each excel corresponding to different days of treatment. i was trying to print the values of the first column for a patient to a single excel, which each column represents different days of treatment values of the 1st column.

i know how to read the values...i just need help on how i can print the values of the 1st column for different days of treatment in different columns.

5 Years
Discussion Span
Last Post by pyTony
Featured Replies

Thank you for your quick response. i looked at the link,

def create_workbook(dstdir, ID, triples, sheet_name = u"TrackingData"):
    name = pjoin(dstdir, ID + ".xls")
    wb = xlwt.Workbook()
        sh = wb.add_sheet(sheet_name)
        for col, val in enumerate("Xvalue Yvalue Zvalue".split()):
            sh.write(0, col, val)
        for row, triple in enumerate(triples, 1):
            for col, val in enumerate(triple):
                sh.write(row, col, val)

this prints all the x values in to one column. i was trying to print only the x values for different days of treatment in different columns, and the same for y value and z value.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.