For example, a user might have to go through thousands of lines and select some useful information to make small changes based on some criteria. Using the Openpyxl module, these tasks can be done very efficiently and easily.
Use this command to install the openpyxl module:
sudo pip3 install openpyxl pre >
Code # 1: Program for printing a specific cell value
# Python Excel file reader
# module import openpyxl
# Specify file location
path cod e> = "C: Users Admin Desktop demo.xlsx"
# To open the workbook # the workbook object has been created
wb_obj = openpyxl.load_workbook (path)
# Get the book of the active sheet of the object # from active attribute
sheet_obj = wb_obj.active
# Cell objects also have row, column, # and coordinates of the attributes that provide # location information for the cell.
# Note: first row or Column integer is 1 , not 0.
# The cell object is created using code > # cell () method of the sheet object.