MARC Utilities

These utilities should work on any system that has Perl installed, unless stated otherwise. Some places you can get Perl from: http://www.activestate.com, http://strawberryperl.com/, and http://www.citrusperl.com/.


marctweak.pl marctweak.pl -parameter1 -parameter2 ...
Default is to filter records and/or perform user-definable actions on them, but both of these can be turned off. Additional functions: create filters, create actions, store these in various files; act on only a particular record type; optionally update 005 for actions; output changed records only; perform a dry run; filter on the presence/absence of a field; split out the different record types in a file; allow text editor editing of MARC records; find duplicate fields in a record; retrieve a field from a record; create and use a control file to conveniently reuse frequent parameter groups; show a progress indicator for some activities. Program contains detailed documentation. No module installation required; it does *not* use MARC::Batch.
marcweeder.pl marcweeder.pl [-config]  |  -infile=file {-outfile=file | -count} [-inifile=file] [-progpct]
Finds records in a MARC file. Counts matching records, optionally writing them to a file. Search conditions can be simple, complex, and/or multiple. Can look at the leader, a field, a subfield, or combinations thereof. Uses a .ini file for control. Has a self-config option: answer questions to create the .ini file. More powerful than marcsearch, and marcedit's find function. First time use: run it without any parameters for usage information. Program contains detailed documentation. No module installation required; it does *not* use MARC::Batch.
marcnth.pl marcnth.pl -infile=file -startrec=N [-howmany=N] [-raw]
Retrieves the Nth record, or several records starting at record N, from a MARC file or one that has been converted to human-readable format by marcread.pl (found elsewhere on this page). The file type is sensed by marcnth. Use the -raw parameter with a MARC file to retrieve the actual MARC record(s).
marcf2r.pl marcf2r.pl [rec-IDnum | recIDnumlistfile] inputfile outputfile [WHLDG] [NOT]
Given one or a list of record ID numbers, copies those records from inputfile to outputfile. Optionally also with holdings records for interleaved file. Can also invert retrieval: everything but the specified records.
marccount.pl marccount.pl filename
Count the MARC records in file filename. Output is to STDOUT (screen).
marcedit.pl marcedit.pl inputfile outputfile [xxxmarcedit.ini]
Add, remove, and/or edit fields in MARC records without programming. With Find, you can restrict your editing to specific records. Using "record" in the Remove section, with Find, lets you completely omit records from the output file. Can also be used to split a MARC file into Unicode and non-Unicode records. Process inputfile to create outputfile. marcedit requires a marcedit.ini file so that it knows what to do. You can optionally supply an .ini file for marcedit to use. If one is not supplied, marcedit assumes that "marcedit.ini" is in the current directory. You do not need to be a programmer to use marcedit, if the currently available functions fill your needs. Merely set up the directives in the .ini file, and run marcedit.
No module installation required; it does *not* use MARC::Batch.
marcedit.ini This is the initialization file for marcedit.pl (see above).
marcedit.readme This is the documentation file for marcedit.pl (see above).
marcread.pl marcread.pl filename
Read the MARC file indicated by filename. Output is human-formatted and goes to STDOUT (screen).
marcrunread.pl marcunread.pl [verbosehelp]  |  infile outfile [force | forcemost]
Takes a file of MARC data that is in marcread (human-readable) format and converts it back to a MARC file. Performs rudimentary error checking. What is this good for? Editing. You have a MARC file that needs a few changes. Use marcread to create a human-readable text file of the MARC data. Use your favorite text editor to make your changes. Then use marcunread to convert the changed data back into a MARC format file. The force and forcemost parameters will mostly let you proceed if MARC errors are found.
marcsearch marcsearch filespec search-string [count | show]
Searches MARC file(s) as indicated by filespec. Output for the count option consists of filenames followed by counts. Output for the show option consists of the filename, and for each marc record in which the search-string is found, the 001 field to identify this record, and then each field containing the search-string.
marcsearch requires two programs to do its job: marcread.pl and marcsearchhelper.pl (both available from this page). marcsearch will typically not run on Windows systems because it is a shell script.
Output goes to STDOUT (screen).
marcsearchhelper.pl marcsearchhelper.pl
Required by marcsearch.
splitmarc.pl splitmarc.pl infilename outfilename chunksize
Splits file specified by infilename into chunks containing the number of lines specified by chunksize. An incrementing counter is appended to outfilename for each chunk so created. Example: splitmarc.pl abcin.this abcthis.out 100 This would create N files abcthis.out.1, abcthis.out.2, etc., each 100 lines in size, as many as necessary to divide abcin.this as specified.
 


For related software by other authors, click here...


The presence of anything on these pages does not necessarily imply any endorsement by any entity other than myself.