tidy up cosmetics, fix bug in -a logic
1 parent 555b7bc commit 6c265891864ee7a1addcc9f26f8462bc2e9e04cb
@tundra tundra authored on 16 Jul 2020
Showing 1 changed file
View
23
xlslu.py
 
PROGNAME = "xlslu.py"
PROGENV = "xlslu".upper()
VERSION = "1.201"
PROGVER = PROGNAME + " " + VERSION + " - Match Strings In XLS Spreadsheets"
 
 
#####
# Copyright Information
#####
 
COPYRIGHT = ""
PROGVER = PROGNAME + " " + VERSION + " - Simple Spreadsheet String Search"
 
 
#####
# List Of All Legal Options - Update This When You Add More!!!!
#####
 
for row in range(sheet.nrows):
 
matched = False
nummatched = 0
matchedstrings = {}
content = []
for col in range(sheet.ncols):
 
# Get value
 
value = str(sheet.cell(row, col).value)
 
# Save, in case we match below and have to report it
content.append(value.strip())
 
for matchstring in MATCHSTRINGS:
if value.lower().count(matchstring.lower()):
matched = True
nummatched += 1
matchedstrings[matchstring] = True
 
# Deal with AND Matching
 
if ALLSTRINGS and (nummatched != len(MATCHSTRINGS)):
if ALLSTRINGS and (len(matchedstrings) != len(MATCHSTRINGS)):
matched = False
 
# Report matching entries