Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 15 lines (11 sloc) 304 Bytes
#!/usr/bin/env ruby
#
# Strip URL fields from each BibTeX file on the command line.
# Write the output to filename.stripped.bib
#
require 'bibtex/parser'
ARGV.each do |file|
BibTeX::Parser.parse(file).map do |entry|
entry.reject_fields [:url]
end.save(file.sub(/\.bib$/, '.stripped.bib'))
end