RE: [greenstone-users] Extracting date from foldername

From James Brunskill
DateThu, 3 Aug 2006 14:55:48 +1200
Subject RE: [greenstone-users] Extracting date from foldername
Thanks John,

That's exactly the sort of thing I was looking for.
I'll give it ago shortly.

It takes a little while to import this collection, it is currently 44GB!
I think I am going to have to figure out some sort of incremental
updates...

Regards,

James Brunskill
Library Systems Consultant
The University of Waikato
Ph: +64 7 838 4323

> -----Original Message-----
> From: John R. McPherson [mailto:jrm21@cs.waikato.ac.nz]
> Sent: Thursday, 3 August 2006 1:04 p.m.
> To: James Brunskill
> Cc: greenstone-users@list.scms.waikato.ac.nz
> Subject: Re: [greenstone-users] Extracting date from foldername
>
> On Thu, Aug 03, 2006 at 12:00:57PM +1200, James Brunskill wrote:
> > Thanks Malathy,
> >
> >
> >
> > As I said in my email, I don't want to have to manually set the
metadata
> > for each folder (There are 164 of them).
> >
> > The folders are already named by their year, is it possible to use
the
> > folder names as extracted metadata?
>
> Hi,
>
> I managed to achieve this by adding 5 lines to BasPlug as shown (in
the
> read_into_doc_obj() function):
>
> # create a new document
> my $doc_obj = new doc ($filename, "indexed_doc");
> $doc_obj->set_OIDtype ($processor->{'OIDtype'});
> +
> + my $import_subdir = dirname($file);
> + if ($import_subdir ne '.') {
> + $doc_obj->add_utf8_metadata($doc_obj->get_top_section(),
> + "ImportSubdir", $import_subdir);
> + }
> +
> $doc_obj->add_utf8_metadata($doc_obj->get_top_section(),
"Language",
> $language);
>
>
> If you then re-import your collection (deleting the old archived
imported
> version) then you will have a metadata field named ImportSubdir.
>
> John