include journals where english is one of several langauges

This commit is contained in:
Mark Eaton 2020-11-26 02:42:07 -05:00
parent c17854c04c
commit 2662951ad2

View File

@ -10,24 +10,21 @@ with open("journallist-June2020.csv", newline="") as csvfile:
data = csv.reader(csvfile)
for row in data:
try:
english = row[30][:7].lower()
if english == "english":
_ = row[30][
7
] # throw an index error if the field is only 'english', nothing more
except IndexError:
if row[4]:
if regex.match(r'^[0-9]{4}-[0-9]{3}[0-9xX]$', row[4]):
output.append(row[4])
if "english" in row[30].lower():
if row[4]:
if regex.match(r'^[0-9]{4}-[0-9]{3}[0-9xX]$', row[4]):
output.append(row[4])
else:
print(row[4], 'regex does not match')
elif row[3]:
if regex.match(r'^[0-9]{4}-[0-9]{3}[0-9Xx]$', row[3]):
output.append(row[3])
else:
print(row[3], 'regex does not match')
else:
print(row[4], 'regex does not match')
elif row[3]:
if regex.match(r'^[0-9]{4}-[0-9]{3}[0-9Xx]$', row[3]):
output.append(row[3])
else:
print(row[3], 'regex does not match')
else:
print("no issn")
print("no issn")
except:
pass
with open("issnlist-June2020.txt", "w") as issnfile:
with open("issnlist-multilingual.txt", "w") as issnfile:
issnfile.write(json.dumps(output))