Skip to content

Instantly share code, notes, and snippets.

Created January 23, 2021 07:41
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
# See for details.
import io
import sys
import os
import argparse
import openpyxl
sys.stdin = io.TextIOWrapper(sys.stdin.buffer, encoding='utf-8')
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
parser = argparse.ArgumentParser(description='Command line option of')
parser.add_argument('-i','--input-file', type=str, help='Name of an input file.',required=True)
args = parser.parse_args()
params = vars(args)
input_file = params['input_file']
if os.path.isfile(input_file) == False:
print("{0:s} is not found.".format(input_file))
wb = openpyxl.load_workbook(input_file)
for ws in wb:
for row in ws.rows:
for cell in row:
if cell.value != None:
print("{0:s} {1:d},{2:d} {3:s}".format(cell.coordinate, cell.row, cell.column, cell.value))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment