Created
August 8, 2021 18:42
-
-
Save jbarrett/73fd3dd45d7bcacce5bf3d88fe2654bc to your computer and use it in GitHub Desktop.
Fix URLs in Mendeley's BibTeX export
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
#!/usr/bin/env perl | |
use IO::All -utf8; | |
my $in = 'library.bib'; | |
my $out = 'library-munged.bib'; | |
my @lines = io($in)->slurp; | |
for my $url ( grep { /^url/ } @lines ) { | |
$url =~ s/\{\\([_\%~&#])\}/\\$1/g; | |
$url =~ s/\{~\}/~/g; | |
} | |
io($out)->print(@lines); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment