Print

Print


On Mon, Jan 25, 2010 at 11:48:47PM +0530, Saiful Amin wrote:
> I also recommend using MARC::Batch. Attached is a simple script I wrote for
> myself.

I think MARC::Batch would be very slow to split lot of records. As 0x1d
is your record separator, a perl oneliner can do the job: 

http://www.tinybox.net/2009/10/12/perl-onliners-vim-and-iso2709/

perl -0x1d -wnE '
    # new file every   1000  records 
    $. == 1 || ! ($. % 1000 )
	# with record number padded with 5 chars 
	and open F,sprintf ">records_%.5d.mrc",$.;
    # actually prints the record 
    print F
' bigfile.mrc

if you file is UTF-8 encoded, use -CSD flags

hope it helps
regards


-- 
Marc Chantreux
BibLibre, expert en logiciels libres pour l'info-doc
http://biblibre.com