Created
January 29, 2019 14:11
-
-
Save jimkutter/b2f2c2cf45444bca91043465b10d2388 to your computer and use it in GitHub Desktop.
Uses python 3, may work with 2.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xlrd | |
import sys | |
from tqdm import tqdm | |
filename = sys.argv[1] | |
book = xlrd.open_workbook(filename) | |
sheet = book.sheet_by_index(0) | |
header = sheet.row(0) | |
with open(filename + ".txt", "w") as outfile: | |
for rx in tqdm(range(sheet.nrows)): | |
first = True | |
for cell in sheet.row(rx): | |
if first: | |
first = False | |
else: | |
outfile.write("|") | |
cell_value = str(cell.value).replace("\n", "") | |
outfile.write(cell_value) | |
outfile.write("\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment