Created
October 24, 2016 23:53
-
-
Save aniquetahir/509bba512a80b20582f8e9772eecb0df to your computer and use it in GitHub Desktop.
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 sys | |
AUTHORS_FILE_NAME = "" | |
AFFILIATIONS_FILE_NAME = "" | |
AUTHOR_AFFILIATION_FILE_NAME = "" | |
authors_file = open(AUTHORS_FILE_NAME) | |
affiliations_file = open(AFFILIATIONS_FILE_NAME) | |
author_affiliation_file = open(AUTHOR_AFFILIATION_FILE_NAME) | |
for auth_aff_line in author_affiliation_file: | |
try: | |
author_id, affiliation_id = auth_aff_line.split("\t") | |
for auth_line in authors_file: | |
for aff_line in affiliations_file: | |
try: | |
auth_id, auth_name = auth_line.split("\t") | |
aff_id, aff_name = aff_line.split("\t") | |
if auth_id == author_id and aff_id == affiliation_id: | |
except e: | |
sys.stderr.write("skipping extry") | |
except e: | |
sys.stderr.write("skipping line: %s" % auth_aff_line) | |
authors_file.close() | |
affiliations_file.close() | |
author_affiliation_file.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment