User manual
Migrating Catalog Data
Let's now look at a specific example
- merging subfields $h and $i, with a space
between the two values, into Koha's call number subfield $o.
First, we setup a Find expression as follows:
( =952 \\\\)(1(\$ h)([ a- zA- Z0- 9 .] *)(*)( \$i)([a- zA- Z0- 9.1*)(. *)
Here is an explanation of this expression:
( =952 \ \ \ \): Look for the pattern =952 \ \. We have four \ in the expression
instead of two, because \ is a special character, and we need to
escape each
occurrence with another \. The round brackets store the matched string in
the first back -reference field.
(. *): Look for any string including "nothing" after the first search pattern,
and stores whatever is matched into the second back -reference field.
( \$h): Look for the subfield $h, and store it in the third back -reference field.
$ is a special character too and is escaped using
a \.
([a- zA- Z0- 9.] *): Look for a string that follows $h and contains
any number
of small letters, capital letters, numbers, or
.,
and store the matched string
into the fourth back reference field.
(. *): Match any string including "nothing" after the $h subfield, and store it
in the fifth back -reference field.
( \$i): Look for the subfield $i, and store it in the sixth back -reference field.
([a- zA- Z0- 9.] *): Look for a string that follows $i and contains
any number of
small letters, capital letters, numbers, or
., and store the matched string into
the seventh back -reference field.
(. *): Match any string after the $i subfield, and store it into the eighth
back -reference field.
And then, we setup the Replace expression as follows:
$1$o$4 $7$2$5$8
[186]