#!/usr/local/bin/perl # # David MacKay 1995 # should be given bibs.bib as argument # bib2mybib.p bibs.bib # reads through the input looking for objects of the form # @burble{burbleMacKayburbleCollaboratingburble} # $file = $ARGV[0] ; # this allows multiline matches $* = 1 ; # read whole file @a= <> ; # toss the comments foreach $aa ( @a ){ $aa =~ s/^\%.*\n//g; } # divide at the @s @b = split ( /@/ , join ( '', @a ) ) ; foreach $e ( @b ) { if ( $e =~ /MacKay/ && $e =~ /Collaborat/ ) { print $e ; } }