Created
March 3, 2021 14:30
-
-
Save elehcim/1874e74c822295e1b37dfb788d3ca8e6 to your computer and use it in GitHub Desktop.
Abbreviate Astronomical journals in a bib file
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
#!/bin/bash | |
# Usage: | |
# abbrv "input_file.bib" > output_file.bib | |
file=$1 | |
awk '{sub(/{Annual Review of Astronomy and Astrophysics}/, "{ARA\{\\\\\\&\}A}"); print}' $file | | |
awk '{sub(/{Monthly Notices of the Royal Astronomical Society}/,"{MNRAS}"); print}' | | |
awk '{sub(/{Mon. Not. R. Astron. Soc}/,"{MNRAS}"); print}' | | |
awk '{sub(/{Publications of the Astronomical Society of the Pacific}/,"{PASP}"); print}' | | |
awk '{sub(/{The Astronomical Journal}/,"{AJ}"); print}' | | |
awk '{sub(/{Astronomical Journal}/,"{AJ}"); print}' | | |
awk '{sub(/{Astrophysical Journal Letters}/,"{ApJL}"); print}' | | |
awk '{sub(/{Astrophysical Journal}/,"{ApJ}"); print}' | | |
awk '{sub(/{The Astrophysical Journal}/,"{ApJ}"); print}' | | |
awk '{sub(/{Astrophysical Journal Supplement Series}/,"{ApJS}"); print}' | | |
awk '{sub(/{The Astrophysical Journal Supplement Series}/,"{ApJS}"); print}' | | |
awk '{sub(/{Astronomy and Astrophysics}/,"{A\{\\\\\\&}A\}"); print}' | | |
awk '{sub(/{Astronomy \{\\\&\} Astrophysics}/,"{A\{\\\\\\&}A\}"); print}' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment