3 # Python script for combining several journal abbreviation lists
4 # and producing an alphabetically sorted list. If the same journal
5 # names are repeated, only the version found last is retained.
7 # Usage: combineJournalLists.py outfile infile1 infile2 ...
15 for i in range(2,len(sys.argv)):
17 f = open(sys.argv[i], "r")
21 parts = line.partition("=")
22 dictionary[parts[0].strip()] = line.strip()
24 print sys.argv[i]+": "+str(count)
26 print "Combined key count: "+str(len(dictionary))
28 f = open(outFile, "w")
29 for key in sorted(dictionary.iterkeys()):
30 f.write(dictionary[key]+"\n")