Working with Excel Spreadsheets

Python is an excellent tool for scanning and manipulating textual data.

FInd word in Excel Spreadsheets


from xlrd import open_workbook

def main():
    excel_file = 'excel.xlsx'
    book = open_workbook(excel_file)
    sheet = book.sheet_by_index(0)
    j = 6
    keyword = 'case'

    for i in range(sheet.nrows):
        value = sheet.cell(i,j).value.lower()
        if value.find(keyword) >= 0:
           print (i, value)

main()