bibtex, perl, programming, scripts

Endnote to BibTeX

If you export from and Endnote Library that has author names in the format A.B.C.Surname then BibTeX won’t interpret the author names properly. I have uploaded a little perl script that opens a .bib file and substitutes the names into ‘A B C Surname’ format. Code is below and script can be downloaded here.

#!/usr/bin/perl -w
my @bibfile;
my $file = $ARGV[0];
my @filename = split(/\./, $file);
my $filestem = $filename[0];

open( INPUT, "<$file" );

@bibfile = <INPUT>; # put each line into an array


my $prefix="edit";
my $outputBIBfile = "$filestem.$prefix.bib";

open( BIBOUTPUT, "> $outputBIBfile");


if ($_ =~ /Author/){

$_ =~ s/\./ /g;


print BIBOUTPUT "$_";


close( BIBOUTPUT );


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s