mirror of
https://github.com/MarkEEaton/open-journal-matcher.git
synced 2024-06-12 20:26:41 +00:00
include journals where english is one of several langauges
This commit is contained in:
parent
c17854c04c
commit
2662951ad2
33
csvdata.py
33
csvdata.py
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue
Block a user