Print

Print


On 12/2/05, Bas Peters <[log in to unmask]> wrote:
>but I was just wondering how difficult it would
> be to create a MARC parser in Ruby. Is there any interest in such a
> library for Ruby?

I actually created a MARC parser in Ruby [1] a month or so ago which
is available on RubyForge [2]. I'm definitely open to ways of
improving it, or developers who want to help develop it.

Since it's available on rubyforge, if you have gem installed you can.

    gem install marc

Once installed you can do stuff like:

    require 'marc'
    reader = MARC::Reader.new('batch.dat')
    for record in reader
        puts record['245']
    end

The rdoc [3] is also available which hopefully shows common usage. One
thing that I haven't implemented yet is MARC-8 -> UTF-8 conversion for
going to XML...but that's in the works. I really like your marc4j
package by the way.

//Ed

[1] http://www.textualize.com/ruby_marc
[2] http://rubyforge.org/projects/marc/
[3] http://www.textualize.com/rdoc/ruby-marc/