[Koha] 852's $h and $i into one 952's $o

Christopher Curry ccurry at amphilsoc.org
Fri Oct 29 05:43:35 NZDT 2010


Maxwell,

I'm no RegExpert, but perhaps this will help:

1. Did you first move your 852$h data and 852$i to 952$h & 952$i, 
respectively?  This RegEx string is looking for data in 952$h & 952$i.  
BTW, you'll probably want to exclude the "(\$.*\$b[A-Za-z0-9.]*)" string 
unless you have $b data to parse.  When I used this find & replace 
string I'm pretty sure I moved the $h & $i to 952 first, combined them 
into $o using the RegEx, then moved other subfields from 852 that I 
wanted to map to 952 subfields.  If you have other subfields in 952 when 
you run this, it can gum up the works (I think).

2. This find & replace operation is looking for any data in $h & $i and 
concatenating it in a new $o.

$1            $2     $3                    $4    $5                    $6
(=952  ..) (\$h) ([A-Za-z0-9.]*) (\$i) ([A-Za-z0-9.]*) 
(\$.*\$b[A-Za-z0-9.]*)

The find string breaks down the 952 field into its constituent parts.

$1$o$3 $5$6

The replace string reassembles the parts in the order you specify, so 
the result should be:

=952  ..$o[The result of "([A-Za-z0-9.]*)" after (\$h), $3] [The result 
of "([A-Za-z0-9.]*)" after (\$i), $5][The result of 
"(\$.*\$b[A-Za-z0-9.]*)", $6]

Hope this helps.

Cheers,

Christopher Curry
Assistant Technical Librarian / Assistant IT Officer

American Philosophical Society
105 South Fifth Street
Philadelphia, PA 19106-3386
Tel. (215) 599-4299

ccurry at amphilsoc.org <mailto:ccurry at amphilsoc.org>

Main Library number: (215)440-3400
APS website: http://www.amphilsoc.org



On 10/28/2010 12:19 PM, SlyzertVoltrond wrote:
>  From the link you gave me:
> "Next enter the following string into the 'Find what' box:
> (=952  ..)(\$h)([A-Za-z0-9.]*)(\$i)([A-Za-z0-9.]*)(\$.*\$b[A-Za-z0-9.]*)
>
> This will take the data from the $h field (and the data could be
> capital letters, lower case letters, numbers and decimals) and the
> data from the $i string (and the data could be capital letters, lower
> case letters, numbers and decimals) and $b is the last subfield in the
> 952 field.
>
> TIP: This regular expression may need to be changed depending on the
> type of data you have in your system. Libraries that use the LC
> classification system in particular may need to tweak the "replace"
> command to find and move cutters.
>
> And enter the following string into the 'Replace with' box:
> $1$o$3 $5$6
>
> This string is saying stay in the same field number as in parenthesis
> #1, move the data from parenthesis #3 of the 'Find what' string next
> to $o, add a space, take the data from parenthesis #5 and move it to
> $o as well, then check to the end of the field and leave all the other
> subfield data alone."
> -------------------------------------------------------------------------------------------------------------------------------------------------
>
> I tried doing the above on my records, but I think it only finds the
> data and doesn't replace anything, because it said "0 modifications
> were made." and took a few seconds to finish. Any ideas on how to move
> the subfields?
>
> regards,
> Maxwell
>
> 2010/10/28 Christopher Curry<ccurry at amphilsoc.org>:
>    
>> Maxwell,
>>
>> Have a look at the "Swapping Fields" section of this page in the old
>> koha.org manual.  It explains how to accomplish this by first moving the 852
>> $h&  $i to 952 $h&  $i, then using a RegEx to combine the two fields into
>> one $o subfield:
>>
>> http://koha.org/documentation/tutorial/using-marcedit/tutorial-all-pages
>>
>> I couldn't find this information in the official docs:
>>
>> http://koha-community.org/documentation/3-2-manual/?ch=a12459
>>
>> Cheers,
>>
>> Christopher Curry
>> Assistant Technical Librarian / Assistant IT Officer
>>
>> American Philosophical Society
>> 105 South Fifth Street
>> Philadelphia, PA 19106-3386
>> Tel. (215) 599-4299
>>
>> ccurry at amphilsoc.org
>>
>> Main Library number: (215)440-3400
>> APS website: http://www.amphilsoc.org
>>
>> On 10/28/2010 10:13 AM, SlyzertVoltrond wrote:
>>
>> How do I use MarcEdit's Find/Replace function to move 852's $h and $i
>> subfield data into one 952's $o subfield? If I try to swap $h of 852
>> to $o of 952 and then do that again for $i of 852 field, I end up
>> creating two $o entries in the 952 field, which I don't think is
>> allowed for call number subfield. Also, I don't have the slightest
>> idea how to use regular expressions to achieve the said task, so I
>> would appreciate it if someone could write it for me, or at least
>> guide me how to write one.
>> regards,
>> Maxwell
>> _______________________________________________
>> Koha mailing list  http://koha-community.org
>> Koha at lists.katipo.co.nz
>> http://lists.katipo.co.nz/mailman/listinfo/koha
>>
>>
>> _______________________________________________
>> Koha mailing list  http://koha-community.org
>> Koha at lists.katipo.co.nz
>> http://lists.katipo.co.nz/mailman/listinfo/koha
>>
>>
>>      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.katipo.co.nz/pipermail/koha/attachments/20101028/a2c1f4c9/attachment.htm 


More information about the Koha mailing list