To avoid introducing double punctuation, you could make the search more
complex to exclude some matches:
Find: (=6.*)([^\.\)\-'"!\?])$
Replace: $1$2.
This finds every subject field whose last character is NOT a mark of
punctuation (that is, one of the characters between the brackets), and
adds a full stop to the end. This way you don't end up, for example,
with two full stops at the end of the field, or a full stop following a
hyphen for a name with only a birth date.
The dollar sign at the end of the match expression indicates that the
character immediately preceding it is the last character in the field.
The brackets within the second pair of parentheses enclose the
characters to match on, and the circumflex ^ following the left bracket
indicates that these characters are actually NOT supposed to match. Each
reverse slash indicates that the next character is just what it appears
to be. So if the last character in the field is a full stop, a right
parenthesis, a hyphen, a single or double quotation mark, an exclamation
mark, or a question mark, the field is ignored, and nothing is done to
it. If the last character in the field is NOT one of those in that
group, the find expression is considered to be a match, and therefore
the field gets replaced. The replacement field is the field itself (in
two parts--the tag and all subsequent characters up to the last one
[$1], and the last character itself [$2]) with a full stop added.
*****************************************
Walter F. Nickeson, Catalog &
Metadata Management Librarian
Rush Rhees Library
University of Rochester
Rochester, NY 14627-0055
[log in to unmask]
(585) 273-2326 fax: (585) 273-1032
*****************************************
-----Original Message-----
From: MarcEdit support in technical and instructional matters
[mailto:[log in to unmask]] On Behalf Of Andy Helck
Sent: Sunday, November 28, 2010 9:25 AM
To: [log in to unmask]
Subject: Re: [MARCEDIT-L] add period to end of 650 fields
Hi Matt,
An example is always welcome, it makes it easier to be precise in
answering your question. But something like the following might do the
trick:
find: =650 \\(.*)
replace: = 650 \\$1.
I am guessing about the "=650 \\" as a reliable prefix to the fields
that you want to change. Take a close look at the fields in your file
and modify the find and replace strings as needed. As with the articles
in the archives, the "(.*)" refers to a "capture group" which will
accept any number of any characters in the remainder of the field. In
the replace string we refer back to this capture group with the "$1"
syntax. Lastly, our replace string has a "." at the end.
Yours,
Andy Helck
Wilkinson Public Library
Telluride CO 81435
________________________________________
From: MarcEdit support in technical and instructional matters
[[log in to unmask]] On Behalf Of Matt Hartman
[[log in to unmask]]
Sent: Saturday, November 27, 2010 7:01 PM
To: [log in to unmask]
Subject: [MARCEDIT-L] add period to end of 650 fields
I see information in archives to remove periods from ends of fields, but
nothing
to tell me how to add them. I need to add full stop to end of subject
fields in
about 200 records. I have not used regular expressions before, so if
that is
involved, please be kind. Thanks for help
Matt
________________________________________________________________________
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]
|