Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- # this script fixes output problems created by Zotero
- original_string = r'''@article{lewitt_serial_1967,
- title = {Serial Project \#1, 1966},
- url = {http://www.ubu.com/aspen/aspen5and6/serialProject.html},
- pages = {n.p.},
- number = {5},'''
- replacement_string = r'''@article{lewitt_serial_1967,
- title = {Serial Project \#1, 1966},
- url = {http://www.ubu.com/aspen/aspen5and6/serialProject.html},
- pages = {n.p.},
- number = {5+6},'''
- input_file_as_single_string = r''
- with open('./bibliography.bib') as input_file:
- for line in input_file:
- input_file_as_single_string += line
- modified_file_as_single_string = input_file_as_single_string.replace(
- original_string,
- replacement_string,
- )
- with open('./bibliography.bib', 'w') as output_file:
- output_file.write(modified_file_as_single_string)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement