Subject: | |
From: | |
Reply To: | |
Date: | Tue, 19 Jul 2011 15:03:55 -0700 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Is the / character actually in the $h you are working with. If it is, that's one of the problems. The other is that the expression expects a $1 at the end of the field. The regular expression is looking for values a-Z (lower-case a-z and upper case A-Z) as well as 0-9, a period and space. If you need to include the / as a valid character and account for the occasional lack of the $1 at the end of the field, you'd change the expression to:
Find What: (=952 ..)(\$h)([A-Za-z0-9. /]*)(\$i)([A-Za-z0-9.]*)(\$k)([A-Za-z0-9. ]*)((\$.*)|(\$1[A-Z]*))
Replace with: $1$o$7 $3 $5$8
--TR
-----Original Message-----
From: MarcEdit support in technical and instructional matters [mailto:[log in to unmask]] On Behalf Of Nora Blake
Sent: Tuesday, July 19, 2011 1:17 PM
To: [log in to unmask]
Subject: [MARCEDIT-L] Regular Expression Help
Hello,
I am working with a regular expression and some data that is less regular than I can cope with. I am trying to concatenate 3 subfields within a field into a new subfield within that same field -- taking the pieces of a call number and smashing them together into a single call number subfield. A regular expression that has worked for me in the past will not work now. I suspect it is because there are some characters in some of the call numbers that are not accounted for in the regular expression. I tried adding the characters in to the regular expression, but it continues to fail. I expect this is because I am not adding the characters correctly.
The regular expression I am using is:
Find what: (=952 ..)(\$h)([A-Za-z0-9. ]*)(\$i)([A-Za-z0-9.
]*)(\$k)([A-Za-z0-9. ]*)(\$.*\$1[A-Z]*)
Replace with: $1$o$7 $3 $5$8
An example of a 952 field that will not change after the expression is run
is:
=952 \\$h940.3 / v. 1$iENC$kREF$p37095001011319$aSTHA$bSTHA
What do I need to do to the $h part of the expression to get it to flip these around for me?
As always, thanks for your help,
Nora
________________________
Nora Blake
MassCat Manager
Massachusetts Library System
P.O. Box 609
South Deerfield, MA 01373-0241
508-357-2121 x123
800-282-7755
Email: [log in to unmask]
AIM: noraatmls
________________________________________________________________________
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]
|
|
|