Build New Field Changes

** Updated: Official Help page in the KB: https://marcedit.reeset.net/build-new-field

This isn’t going to meet all the use cases I’ve seen – but this should address the most common question that comes up – the ability to have the build new field generate multiple fields.

The process will be based on the presence or lack of a new element in the pattern – a variable marker that will MarcEdit uses internally to hold an internal variable.

Example:

=040  \\$aMiU$cMiU

=040  \\$aBDS$beng$cBDS$dOCLCQ$dABCU

=041  \\$aengrusger

=043  \\$ae-gx—$ae-uk—$an-us—

=090  \\$aTK1005$b(INTERNET) $c[UK.]

Say we have these fields – and the pattern I want to create is a 999 field, and in that field, I want to create a new 999 field for each 040$a – but I would also like to have the 090$a to be a part of the pattern.

The new pattern would look like this:

=999  \\$a{040$a[x]} : {090$a}

This pattern would generate the following results:

=999  \\$aMiU : TK1005

=999  \\$aBDS : TK1005

If I changed the pattern to:

=999  \\$a{040$a} : {090$a}

The program falls back to use the current functionality (only one field is created).

Please note, you cannot ask for a specific 040 to be used (outside of using find/reg functions inside the pattern) – the data inside the [x] isn’t an integer you can set.  It is a value that indicates to MarcEdit that the subfield should be tracked and multiple fields are desired.

The [x] syntax works both after the subfield or after the field number, with data being scoped based on the location of the [x].  Any other value other than [x] will likely result in inconsistent results.  The [x] bracket is a reserved element within the field to indicate that multiple field generation is desired, and to tell the program to tokenize the data marked.

Finally – the tool placed data in the index range of the new field being generated.  So, consider this example:

=040  \\$aMiU$cMiU

=040  \\$aBDS$beng$cBDS$dOCLCQ$dABCU

=041  \\$aengrusger

=043  \\$ae-gx—$ae-uk—$an-us—

=090  \\$aTK1005$b(INTERNET) $c[UK.]

If I used the following pattern:

=999  \\$a{040$a[x]} : {090$a[x]}

The expected results would be:

=999  \\$aMiU : TK1005

=999  \\$aBDS :

Why?  Because the tool will slot values marked with the multi-field value [x] into the same field groups.  Since only one 090$a exists, the tool only updates the field group that it belongs.  However, if I had the following data:

=040  \\$aMiU$cMiU

=040  \\$aBDS$beng$cBDS$dOCLCQ$dABCU

=041  \\$aengrusger

=043  \\$ae-gx—$ae-uk—$an-us—

=090  \\$aTK1005$b(INTERNET) $c[UK.]

=090  \\$aG24211$b(INTERNET)

And used this pattern:

=999  \\$a{040$a[x]} : {090$a[x]}

I would expect the following result:

=999  \\$aMiU : TK1005

=999  \\$aBDS : G24211

Again – internally, MarcEdit is creating tokens of data with the [x] and placing them within the same scope.  So, the tool would create new fields, placing data within the same scope onto the new fields.

I started making these changes with the last update – and have finished updating the tokenization algorithms so that the tracking of the data is correct.  I’ll be turning this new option on with the next update – and across both the Windows and Mac version.

Since the presence of the [x] is necessary to turn on the multi-field generation, any existing patterns within tasks shouldn’t be impacted by the changes.  They will work as they had previously.  Only patterns with the new [x] structure will activate the new processing logic.


Posted

in

by

Tags: