Created
May 11, 2022 06:31
-
-
Save nikosavola/31dac8430e272dd847283ec07efc27d9 to your computer and use it in GitHub Desktop.
Very bruteforce sed commands to convert BibTeX month fields to int, see https://tex.stackexchange.com/questions/351103/convert-month-jan-or-month-jan-strings-in-bib-files-into-integer
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 | |
sed -i -e 's/\(^ *month\) *= *["{]{*jan}*[}"]/\1 = "1"/i' references.bib | |
sed -i -e 's/\(^ *month\) *= *["{]{*feb}*[}"]/\1 = "2"/i' references.bib | |
sed -i -e 's/\(^ *month\) *= *["{]{*mar}*[}"]/\1 = "3"/i' references.bib | |
sed -i -e 's/\(^ *month\) *= *["{]{*apr}*[}"]/\1 = "4"/i' references.bib | |
sed -i -e 's/\(^ *month\) *= *["{]{*may}*[}"]/\1 = "5"/i' references.bib | |
sed -i -e 's/\(^ *month\) *= *["{]{*jun}*[}"]/\1 = "6"/i' references.bib | |
sed -i -e 's/\(^ *month\) *= *["{]{*jul}*[}"]/\1 = "7"/i' references.bib | |
sed -i -e 's/\(^ *month\) *= *["{]{*aug}*[}"]/\1 = "8"/i' references.bib | |
sed -i -e 's/\(^ *month\) *= *["{]{*sep}*[}"]/\1 = "9"/i' references.bib | |
sed -i -e 's/\(^ *month\) *= *["{]{*oct}*[}"]/\1 = "10"/i' references.bib | |
sed -i -e 's/\(^ *month\) *= *["{]{*nov}*[}"]/\1 = "11"/i' references.bib | |
sed -i -e 's/\(^ *month\) *= *["{]{*dec}*[}"]/\1 = "12"/i' references.bib |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment