Read excel file and extract the details into a new .txt file using openpyxl
I am new to openpyxl, just started yesterday. I need to extract the data from the excel file from my local storage that excel file have 500+ rows and 50+ columns. I want to extract some specific cells or columns or rows into the .txt and .csv file.
I cannot find where is the mistake what to add in this code
from openpyxl import *
import os
path = 'F:\\mis'
files = [i for i in os.listdir(path) if i.endswith('.xlsx')]
for f in files:
wb = load_workbook(os.path.join(path, f))
for row in wb['newxl.xlsx'].rows:
with open(row[2].value+'.txt', 'w') as outfile:
outfile.write(row[0].value)```