Another tack you could try would be switching the subfield $a in the 653
field to another value, say a capital letter, which isn't used as a
subfield value in your file. You could search your file for the value
first (say: $Q) to be sure it doesn't exist.
Then use edit subfields with "a" in the subfield box, "^c" (that's a
caret followed by a c) in the field data box, and "Q" in the replace
with box. This will change all your $a to $Q in the selected field.
Note: don't use the quotation marks.
Now do a straight Replace of $Q with nothing.
Finally, use your original idea of replacing "=653 //" with "=653
//$a" to get the initial subfield back. (Again, no quotation marks
needed--this wouldn't be a regular expression.)
Kathleen
-----Original Message-----
From: MarcEdit support in technical and instructional matters
[mailto:[log in to unmask]] On Behalf Of Kathryn Lybarger
Sent: Wednesday, December 02, 2009 2:35 PM
To: [log in to unmask]
Subject: Re: [MARCEDIT-L] removing extra subfields in 520
Michael,
The replace side of my suggestion should look like: $1;
(dollar, one, semicolon with no quotes around it)
Are you sure that the contents are not changing? It may be hard to see,
since it should start its replacing with the LAST $a on each line. The
parentheses (which enclose what will eventually become $1) should
capture everything from the beginning of the 520 line up to right before
the last $a. You may have to hit Replace All a few times so that it can
creep up to the front. If you do that, does the number of replacements
it makes change?
If that does not work, you might try using the regular expression in the
Find tab (as opposed to the Replace tab) just to see what sorts of
things it is matching. It should match from the beginning of the 520
line through (and including) the last $a.
Here's a slightly different one to match with:
(^=520 .....*?)\$a
That should be slightly safer (it is anchored, so will only match =520
that appear at the beginning of the line) and should start with the $a
nearest to the front (still skipping the very first one).
Hope this helps,
Kathryn
Michael J Dulock wrote:
> Thanks for the help, Kathryn & Joel. I'm still having trouble with the
> syntax. ME says "X replacements made" but the contents of the 520 are
> unchanged. What should the "replace" side of the expression look like?
> I've tried a couple variations that include "$1;" and neither seems to
> do the job...
>
> Thanks again,
>
> Michael
>
>
> -----Original Message-----
> From: MarcEdit support in technical and instructional matters
> [mailto:[log in to unmask]] On Behalf Of Joel Marchesoni
> Sent: Wednesday, December 02, 2009 6:32 AM
> To: [log in to unmask]
> Subject: Re: removing extra subfields in 520
>
> Hi Michael,
>
> I would go with your own suggestion of replacing all of the '$a's with
> a semicolon then replace the beginning ('=520 0\;') with '=520
> 0\$a'. I think that should work just fine.
>
> Joel
>
> Michael,
>
> If you replace "(=520 .....*)\$a" with "$1;", that should replace one
> of the extraneous $a's with a semi-colon. If you just keep hitting
> the Replace All button until it says "0 modifications made", you
should get all of them.
>
> Kathryn
>
> -----Original Message-----
> From: MarcEdit support in technical and instructional matters
> [mailto:[log in to unmask]] On Behalf Of Michael J Dulock
> Sent: Tuesday, December 01, 2009 5:45 PM
> To: [log in to unmask]
> Subject: removing extra subfields in 520
>
> Hi folks,
>
> I've been playing with this for some time and am having no luck. It
> doesn't help that what little I can do with regular expressions I
> learned by backwards engineering those supplied by others...
>
> Anyway, I'm going to be loading a large number of records from one
> source into our catalog, some of which contain a 653 field with
> multiple keywords in it. Our policy is to change 653s into 520 1st
> indicator 0 for subject strings, which I've done without incident. The
> problem is that each term is preceded by a $a, as in:
>
> =520 0\$aAerosols$aComputer Calculations$aDiffuse Solar
> Radiation$aDirect Solar Radiation
>
> I'd like to replace all but the first $a with a semicolon or comma,
> but I can't figure out how to get a regular expression to do it (if
> one can). It would also work to replace all the $a, then I could put
> the initial required one back in by replacing "=520 0\;" with "=520
0\$a".
>
> I realize this may be too variable a characteristic for a regular
> expression to fix, but I thought I'd try the collective wisdom before
> I go through and manually fix them.
>
> Any ideas?
>
> Thanks much in advance,
>
> Michael
>
>
> ____________________________________________
> Michael Dulock
> Assistant Professor
> Metadata Librarian
>
> University of Colorado at Boulder Libraries Cataloging & Metadata
> Services Department
> 184 UCB, 1720 Pleasant Street
> Boulder, Colorado 80309-0184
>
> Phone: 303-492-5518
> Fax: 303-492-0494
> E-mail: [log in to unmask]
> http://ucblibraries.colorado.edu/_____________________________________
> ______
> _
>
> ______________________________________________________________________
> __
>
> This message comes to you via MARCEDIT-L, a Listserv(R) list for
> technical and instructional support in MarcEdit. If you wish to
> communicate directly with the list owners, write to
> [log in to unmask] To unsubscribe, send a message
> "SIGNOFF MARCEDIT-L" to [log in to unmask]
>
> ______________________________________________________________________
> __
>
> This message comes to you via MARCEDIT-L, a Listserv(R) list for
> technical and instructional support in MarcEdit. If you wish to
> communicate directly with the list owners, write to
> [log in to unmask] To unsubscribe, send a message
> "SIGNOFF MARCEDIT-L" to [log in to unmask]
>
> ______________________________________________________________________
> __
>
> This message comes to you via MARCEDIT-L, a Listserv(R) list for
technical and instructional support in MarcEdit. If you wish to
communicate directly with the list owners, write to
[log in to unmask] To unsubscribe, send a message
"SIGNOFF MARCEDIT-L" to [log in to unmask]
>
________________________________________________________________________
This message comes to you via MARCEDIT-L, a Listserv(R) list for
technical and instructional support in MarcEdit. If you wish to
communicate directly with the list owners, write to
[log in to unmask] To unsubscribe, send a message
"SIGNOFF MARCEDIT-L" to [log in to unmask]
________________________________________________________________________
This message comes to you via MARCEDIT-L, a Listserv(R) list for technical and instructional support in MarcEdit. If you wish to communicate directly with the list owners, write to [log in to unmask] To unsubscribe, send a message "SIGNOFF MARCEDIT-L" to [log in to unmask]
|