Created
October 26, 2022 13:58
-
-
Save J535D165/6ac038da12c041c018094ebb80ac4597 to your computer and use it in GitHub Desktop.
Add keywords to the abstract field of a RIS file
This file contains hidden or 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 rispy | |
| entries_new = [] | |
| with open('test.ris', 'r') as bibliography_file_in: | |
| entries = rispy.load(bibliography_file_in) | |
| for entry in entries: | |
| entry_new = entry.copy() | |
| if "keywords" in entry: | |
| entry_new["abstract"] = " ⭐ ".join(entry_new["keywords"]) + "⭐ \n\n" + entry_new["abstract"] | |
| entries_new.append(entry_new) | |
| with open("result.ris", 'w') as bibliography_file_out: | |
| rispy.dump(entries_new, bibliography_file_out) |
Author
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Requires rispy (
pip install rispy).Please keep in mind that abstracts are sometimes stored in a different tag. For example,
abstract_note.