Re: Deleting a subfield using MARC::Record

2006-05-03 Thread Edward Summers
On May 1, 2006, at 4:41 PM, Leif Andersson wrote: +1 count can possibly be complemented or replaced with occurrence as suggested. It'd be nice to be able to denote last occurrence [-1]. And I suppose the indexing should be based on ordinary perl subscript indexing - i.e. governed by the

Re: Deleting a subfield using MARC::Record

2006-05-03 Thread Edward Summers
On May 3, 2006, at 6:28 AM, Edward Summers wrote: $field-delete_subfield(pos = 2); won't work because 'pos' is a perl keyword-- I should've tried it before I said this -- it works fine in that context, even though my perl syntax highlighter indicates otherwise. So I've changed the

Re: Deleting a subfield using MARC::Record

2006-05-03 Thread Michael Kreyche
Edward Summers wrote: The current documentation for the new method reads like this: -- delete_subfield() allows you to remove subfields from a field: # delete any subfield a in the field $field-delete_subfield(code = 'a'); # delete any subfield a or u

Re: Deleting a subfield using MARC::Record

2006-05-03 Thread Mark Jordan
Brad Baxter wrote: On 5/3/06, Michael Kreyche [EMAIL PROTECTED] wrote: The term position (pos) seems a little ambiguous to me on the face of it. Does (code = 'u', pos = 0) mean the first subfield u (which is what I take it to mean) or subfield u if it's the first subfield (which it might

Re: Deleting a subfield using MARC::Record

2006-05-03 Thread Edward Summers
On May 3, 2006, at 8:55 AM, Mark Jordan wrote: I think it should mean the zeroth occurrence of subfield 'u', since specifying which of a repeated group of subfields is a realistic task, as you say. For example, each record has two 'u's but all of the first ones are garbage. Actually

Re: Deleting a subfield using MARC::Record

2006-05-03 Thread Michael Kreyche
Edward Summers wrote: On May 3, 2006, at 8:55 AM, Mark Jordan wrote: I think it should mean the zeroth occurrence of subfield 'u', since specifying which of a repeated group of subfields is a realistic task, as you say. For example, each record has two 'u's but all of the first ones are

Re: Deleting a subfield using MARC::Record

2006-05-03 Thread Mark Jordan
Ed, the only problem I can see with position in the field is if a preceding subfield does not exist in every record. For example, in a given batch, most but not all records have an 856 subfield 3, followed by multiple subfield u's. If you ask to delete the first u using pos, then your target

Re: Deleting a subfield using MARC::Record

2006-05-03 Thread Edward Summers
On May 3, 2006, at 11:25 AM, Mark Jordan wrote: For example, in a given batch, most but not all records have an 856 subfield 3, followed by multiple subfield u's. If you ask to delete the first u using pos, then your target will be different determined by the presence of subfield 3. If

Re: Deleting a subfield using MARC::Record

2006-05-02 Thread Brad Baxter
On 5/1/06, Edward Summers [EMAIL PROTECTED] wrote: On May 1, 2006, at 1:24 PM, Brad Baxter wrote: # delete first two subfield u $field-delete_subfield(code = 'u', count = 2); I don't think I like it this way. How would you delete just the second one? I'd rather see 'count' mean

Re: Deleting a subfield using MARC::Record

2006-05-02 Thread Ben Soares
++ sorry, couldn't resist

Re: Deleting a subfield using MARC::Record

2006-05-02 Thread Timothy Prettyman
+1 I like Leif's proposal. It also might be useful to allow code to accept multiple values. -Tim Timothy Prettyman LIT/LIbrary Systems University of Michigan On May 1, 2006, at 5:41 PM, Leif Andersson wrote: +1 count can possibly be complemented or replaced with occurrence as

Re: Deleting a subfield using MARC::Record

2006-05-01 Thread Mark Jordan
Edward Summers wrote: On Apr 29, 2006, at 10:31 AM, Mark Jordan wrote: Maybe other people should verify the usefulness of a delete subfield function before anyone does anything about it, though. Would a half dozen +1 votes from perl4libers validate its usefulness? Yes it would...but to get

RE: Deleting a subfield using MARC::Record

2006-05-01 Thread Bryan Baldus
OK -- here's the call for a vote. All interested perl4lib members are encouraged to participate by emailing the list. +1 Bryan Baldus [EMAIL PROTECTED] [EMAIL PROTECTED] http://home.inwave.com/eija

Re: Deleting a subfield using MARC::Record

2006-05-01 Thread Edward Summers
+1 :-) //Ed

Re: Deleting a subfield using MARC::Record

2006-05-01 Thread Gary Bertchume
+1 //Gary -- === Gary Bertchume Library Systems Analyst Columbia University Libraries 212 854-8582 [EMAIL PROTECTED] ===

Re: Deleting a subfield using MARC::Record

2006-05-01 Thread Brad Baxter
On 5/1/06, Bryan Baldus [EMAIL PROTECTED] wrote: On Monday, May 01, 2006 1:24 PM, Brad Baxter wrote: On 4/30/06, Edward Summers [EMAIL PROTECTED] wrote: [snip] # delete first two subfield u $field-delete_subfield(code = 'u', count = 2); I don't think I like it this way. How would you delete

Re: Deleting a subfield using MARC::Record

2006-05-01 Thread Edward Summers
On May 1, 2006, at 1:24 PM, Brad Baxter wrote: # delete first two subfield u $field-delete_subfield(code = 'u', count = 2); I don't think I like it this way. How would you delete just the second one? I'd rather see 'count' mean 'occurrence', so the above would mean delete the second

Re: Deleting a subfield using MARC::Record

2006-04-30 Thread Edward Summers
On Apr 29, 2006, at 10:31 AM, Mark Jordan wrote: Maybe other people should verify the usefulness of a delete subfield function before anyone does anything about it, though. Would a half dozen +1 votes from perl4libers validate its usefulness? Yes it would...but to get the changes out on

Re: Deleting a subfield using MARC::Record

2006-04-29 Thread Mark Jordan
Edward Summers wrote: Deleting subfields is a bit tricky since subfields may repeat, and sometimes people just want to delete one of them. An unfortunate state of affairs perhaps. Yeah, I can see what you're saying, but doesn't that also apply to repeatable fields? If a particular subfield

Re: Deleting a subfield using MARC::Record

2006-04-29 Thread Edward Summers
On Apr 29, 2006, at 1:08 AM, Mark Jordan wrote: Edward Summers wrote: Deleting subfields is a bit tricky since subfields may repeat, and sometimes people just want to delete one of them. An unfortunate state of affairs perhaps. Yeah, I can see what you're saying, but doesn't that also

Re: Deleting a subfield using MARC::Record

2006-04-29 Thread Michael Kreyche
Edward Summers wrote: That could work if subfields were objects, but they're just strings. It could simply delete all of them unless a second parameter is passed in, which would basically act like a filter: $field-delete_subfield('a', qr/badsubject/); That sounds pretty good, though I'm

Re: Deleting a subfield using MARC::Record

2006-04-29 Thread Mark Jordan
Edward Summers wrote: On Apr 29, 2006, at 1:08 AM, Mark Jordan wrote: Edward Summers wrote: Deleting subfields is a bit tricky since subfields may repeat, and sometimes people just want to delete one of them. An unfortunate state of affairs perhaps. Yeah, I can see what you're saying, but

Deleting a subfield using MARC::Record

2006-04-28 Thread Mark Jordan
Hi everybody, Any advice on how I'd go about using MARC::Record to delete just a specific subfield? The old MARC.pm had deletemarc(), which would delete entire records, specific fields, as well as specific subfields depending on what parameters are passed to it. Or should I just reconstruct

Re: Deleting a subfield using MARC::Record

2006-04-28 Thread Edward Summers
On Apr 28, 2006, at 8:20 PM, Michael Kreyche wrote: my $new856f = MARC::Field-new('856',$i1,$i2,@new856s); $field-replace_with($new856f); If there's an easier way, I'd like to know! Creating a new field and replacing the old one with the new one is the way to go. Deleting subfields is a