Play with Excel: Using Python : OPENPYXL by KODURI BHARGAV

Play with Excel: Using Python : OPENPYXL by KODURI BHARGAV

Author:KODURI BHARGAV [BHARGAV, KODURI]
Language: eng
Format: azw3, epub
Published: 2020-10-06T00:00:00+00:00


save this below program as list.py

from openpyxl import load_workbook

filename='D:\first.xlsx'

wb = load_workbook(filename)

sheet = wb['Sheet']

for i in range(1,sheet.max_row):

print(sheet.cell(row = i, column = 1).value,sheet.cell(row = i, column = 2).value)

Output:

Module 3: Search a record in the excel

Search with a name, and find out their number.

Procedure:

1. Open the excel sheet.

2. Enter the name in the variable "search"

3. Search in the 1st column, and all rows start from 2nd row to sheet.max_row

4. When the match found, read the value from the corresponding phone number



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.