Skip to main content

Better, Not Perfect: Sample MarcEdit Tasklists for Batch Processing

These are MarcEdit task lists that were used as examples in the presentation Better, Not Perfect: Cataloging and Data Manipulation Strategies for Improving OCLC Records for Licensed Digital Resources, presented February 19, 2019 by Jim Soe Nyun and Kurt Hanselman at the Music OCLC Userts Group annual meeting. 

Click HERE to access a text file of this page without hidden web formatting.

Click on the file names below to download the compiled MarcEdit task list.

 "Remove bad 856s" task list
This task list will remove 856 fields with institution-specific URLs, by searching for any 856 field containing the specific textstring: "login?url=http://". This can be useful if the proxy URL is constructed consistently across the set. We have this set up just so any 856 field containing that string will be completely removed from the record, so some records may be left with no 856s after running this task list. Because of this, we recommend also running the "Identify missing 856" task list.

Add Delete Field Task
Field: 856
Field data: login?url=http://
Click "Delete Field"

"008 Fill and Blank Character Fix" task list
Some records (particularly music records) will have a problematic fill character in position 20 of the 008 field. While this is a legitimate MARC value, it causes issues when exported to the Millennium Integrated Library System, with the positions of subsequent 008 codes being jumbled. This simple task list replaces the fill character with the value for unknown ("u"), the OCLC default value for this position. Loading records with the problematic fill character into an ILS can cause several 008 errors, including incorrect language codes to export. This is worth using on every record imported via the OCLC Connexion Bib File Reader plugin, as this is a common problem with records imported through that workflow. The second task will replace all 008 fields with a blank character in position 20 and supply the default value "u".

1.
Add Replace All Task
Find: (=008  .{20})∎(.*)
Replace: $1u$2
Search options >> select "Use regular expressions"
Click "Replace All"

2.
Add Replace All Task
Find: (=008  .{20}) (.*)
Replace: $1u$2
Search options >> select "Use regular expressions"
Click "Replace All"

"Add composer designator" task list
This task will add the string "$ecomposer" to 100 fields lacking that relationship designator. This is generally safe to use even if there are already some $e composer strings present in the record, as it will also delete any doubling of the $e composer string that may have been created inadvertently. Don't use this task if there might be agents OTHER THAN composers in the 100 field (for example, with some records for sound recordings).

1.
Add Field Edit Task
Field: 100
Find: (.*\D){4}(\.$)
Replace: $1,$ecomposer$2
Options >> select "Use Regular Expressions"
Click "Process"

2.
Add Field Edit Task
Field: 100
Find: (.*\D{4})
Replace: $1,$ecomposer.
Options >> select "Use Regular Expressions"
Click "Process"

3.
Add Field Edit Task
Field: 100
Find: (.*\))($)
Replace: $1,$ecomposer.$2
Options >> select "Use Regular Expressions"
Click "Process"

4.
Add Field Edit Task
Field: 100
Find: (.*\d{4})(\.$)
Replace: $1,$ecomposer$2
Options >> select "Use Regular Expressions"
Click "Process"

5.
Add Field Edit Task
Field: 100
Find: (.*\d{4}\-)($)
Replace: $1,$ecomposer.$2
Options >> select "Use Regular Expressions"
Click "Process"

6.
Add Field Edit Task
Field: 100
Find: (.*\d\?)($)
Replace: $1$ecomposer.$2
Options >> select "Use Regular Expressions"
Click "Process"

7.
Add Replace All Task
Find: (\$ecomposer.)(\$ecomposer.$)
Replace: $2
Search options >> select "Use Regular Expressions"
Click "Replace All"

 "Transform 700 12 to 240" task list
This task transforms the first 700 12 title into a 240 field. Use selectively when your resource lacks 240s but has a 700 12 for the resource as encountered in some parts of the Classical Scores Library Volume 1 set.

1.
Add Replace All Task
Find: (\=700  12.*\$t)(.*)([^\da-zA-Z?)!♭#"])
Replace: =240  10$a$2
Search options >> select "Use regular expressions"
Click "Replace All"

2.
Add Replace All Task
Find: (\=240.*\.\.)$
Replace: $1.
Search options >> select "Use regular expressions"
Click "Replace All"

 ---"De-Anonymizer" task list
This task will remove 100 fields that have a $a for "Anonymous" and a 245 field with first indicator 1. The 100 field will be stripped out entirely and the 245 first indicator will be changed to 0, since there is no longer a 100 field and (no added entry).

Add Replace All Task
Find: (\=100  1.\$aAnonymous.*)(\=245  )1(.*)/m
Replace: ${2}0$3
Search options >> select "Use regular expressions"
Click "Replace All"

"ZXX correction" task list
This task list is intended to fix erroneous language codes in records for instrumental music scores. This task changes the language value to "zxx" when the subjects correspond to those used for instrumental music. The task list is best used for single-work resources, since there might be multiple terms that apply to different parts of the resource. Also, the task list may need to be edited when there might be vocal components added to some of the basic instrumental combinations (e.g., Symphonies or Quartets). Note that this list also includes the names of common instruments that might be the first word in a sting like "Piano music," which you'd find in a 650. If you have resources for more exotic instruments, e.g. Zither, you can add the term to the list below. Note that the instruments are grouped by instrument family.
For example, to remove Symphonies from the list of 650s, open the task list, select the single Find and Replace task, look in the Find box, and remove the pipe preceding the text you want to ignore, then remove the text itself. To add any terms to the list, just precede your term with a pipe and then add it to the end of the string.

Add Replace All Task
Find: (=008  .{35}).{3}(.*=650  .{2}\$a)(Sonatas|Trio sonatas|Symphonies|Overtures|Concertos|Concerti grossi|Dances|Suites|Variations|Rondos|Instrumental music|Instrumental ensembles|Keyboard|Piano|Organ|Harpsichord|String|Violin|Viola|Cello|Double bass|Woodwind|Flute|Piccolo|Alto flute|Bass flute|Oboe|English horn|Clarinet|Alto clarinet|Bass clarinet|Contrabass clarinet|Basset horn|Bassoon|Contrabassoon|Brass|Horn|Trumpet|Cornet|Flügelhorn|Euphonium|Trombone|Bass trombone|Tuba|Percussion|Timpani|Xylophone|Marimba|Vibraphone|Plucked instrument|Harp|Guitar|Lute|Wind|Band|Orchestra|Chamber orchestra|Trios|Quartets|Quintets|Sextets|Septets|Octets|Nonets)(.*)/m
Replace: $1zxx$2$3$4
Search options >> select "Use regular expressions"
Click "Replace All"

 "FixLang with 546 data" task list
This task list will generate a Lang code by searching for the presence of a 546 statement. Common statements are mapped to their corresponding MARC code, e.g. “546 In English” maps to “Lang: eng”… Task list is most effective when run after the “zxx correction” task.
This task list has been tailored to the set being demonstrated. A larger pool of languages could be developed for general resources. Also, the wording being searched for could be genericized, and language statements will not always take the form “In [language].”

1.
Add Replace All Task
Find: (=008  .{35})zxx(.*=546  .{2}\$a)(In Latin)(.*)/m
Replace: $1lat$2$3$4
Search options >> select "Use Regular Expressions"
Click "Replace All"

2.
Add Replace All Task
Find: (=008  .{35})zxx(.*=546  .{2}\$a)(In Spanish)(.*)/m
Replace: $1spa$2$3$4
Search options >> select "Use regular expressions"
Click "Replace All"

3.
Add Replace All Task
Find: (=008  .{35})zxx(.*=546  .{2}\$a)(In Portuguese)(.*)/m
Replace: $1por$2$3$4
Search options >> select "Use regular expressions"
Click "Replace All"

4.
Add Replace All Task
Find: (=008  .{35})zxx(.*=546  .{2}\$a)(In Russian)(.*)/m
Replace: $1rus$2$3$4
Search options >> select "Use regular expressions"
Click "Replace All"

5.
Add Replace All Task
Find: (=008  .{35})zxx(.*=546  .{2}\$a)(In Italian)(.*)/m
Replace: $1ita$2$3$4
Search options >> select "Use regular expressions"
Click "Replace All"

6.
Add Replace All Task
Find: (=008  .{35})zxx(.*=546  .{2}\$a)(In English\.)(.*)/m
Replace: $1eng$2$3$4
Search options >> select "Use regular expressions"
Click "Replace All"

7.
Add Replace All Task
Find: (=008  .{35})zxx(.*=546  .{2}\$a)(In French\.)(.*)/m
Replace: $1fre$2$3$4
Search options >> select "Use regular expressions"
Click "Replace All"

8.
Add Replace All Task
Find: (=008  .{35})zxx(.*=546  .{2}\$a)(In French\, Middle)(.*)/m
Replace: $1frm$2$3$4
Search options >> select "Use regular expressions"
Click "Replace All"

9.
Add Replace All Task
Find: (=008  .{35})zxx(.*=546  .{2}\$a)(In German\.)(.*)/m
Replace: $1ger$2$3$4
Search options >> select "Use regular expressions"
Click "Replace All"

"Identify Missing 856" task list
This task list will search for any records lacking an 856 field and supply one with the text “Missing 856 field” in the $a. If any changes are made, URLs will have to be added manually and individually, by searching for that added text to identify each record that needs a URL. Sometimes this just occurs because the only 856 field in the Master record was a local 856 with the institution’s proxy URL. In this set, the “neutral” URL is quite easy to derive from proxy URL. Best to run this task after the RemoveBad856s task.

Add New Field Task
Field: 856
Field data: $aMissing 856 field.
Options >> Select "Add field only if not present"
Click "Add Field"

"tidy bad 007s" task list
One glitch with the OCLC Bibfile Reader plugin for MarcEdit is that 007 fields lacking a character in the $d position will corrupt when the records are returned to Connexion. This task adds a pipe in the position of $d for strings lacking a value in that position.

Add Replace All Task
Find: (\=007..)(.{3})(.{10})$
Replace: $1$2|$3
Search options >> select "Use regular expressions"
Click "Replace All"

Provider Neutral cleanup ("Remove Classical scores library") task list
This task list will remove the package/provider-specific series statements in the 490/830 fields when those records have 040 fields coded as provider-neutral ($e pn). The task list searches specifically for the presence of the phrase “Classical Scores Library.” This is useful if the phrase is consistently applied, because it won’t catch other possible provider-specific series statements unless specifically programmed to do so.

1.
Add Replace All Task
Find: (\=830.*)(\$aClassical [Ss]cores [Ll]ibrary.*)$
Replace: $1$aDELETE THIS FIELD
Check box for "Perform Find/Replace If..." and enter: \=040.*\$epn.*
Search options >> select "Use regular expressions"
Click "Replace All"

2.
Add Delete Field Task
Field: 830
Field Data: $aDELETE THIS FIELD
Click "Delete Field"

3.
Add Replace All Task
Find: (\=490.*)(\$aClassical [Ss]cores [Ll]ibrary.*)$
Replace: $1$aDELETE THIS FIELD
Check box for "Perform Find/Replace If..." and enter: \=040.*\$epn.*
Search options >> select "Use regular expressions"
Click "Replace All"

4.
Add Delete Field Task
Field: 490
Field Data: $aDELETE THIS FIELD
Click "Delete Field"