howdy, i am submitting another quasi-article for your LIBSOFT archive. Deals with having an online search output compared against local journal holdings,in either ms-dos or unix Doing the journal hunt in MS-DOS or UNIX by dan mahoney centennial science and engineering library univeristy of new mexico nm dmahone@hal.unm.edu WHAT_IT_IS:: We have a pc that dials dialog, and we do a capture log of the search to a file called procomm.log After each search, the log is checked to see if we hold any of the journals. This is done via a perl program that extracts the ISSN and CODEN fields from a dialog record. So if the CODEN or ISSN are not displayed then this will not work. After perl works on the capture log it passes a file of issn numbers and codens to fgrep, which in turn searches the file against a file of local journal holdings. WHAT_YOU_NEED: Below is perl code that we use on a ms-dos machine to check for local journals after an online search. ************************************************ **In case you are not aware perl and fgrep are unix **programs originally,but have been ported to MS-DOS, **so if you have perl installed on your vax then you **can run this on a unix machine. You would have to **change a few lines if your are running this on unix. **************************************************** You will need to anonymous ftp the following program from wuarchive.wustl.edu /pub/mirrors/txtutl/fgrep172.zip and the following from msdos.archive.umich.edu /msdos/unix/perl3.zip There is a copy of perl at wuarchive, but I had problems unzipping it. You also need a file which has a list of your journal holdings in a similiar format. The order is not necessary, but you need to fit everything for the journal on one line. callnumber title issn coden Codens are necessary for some of the bio-ish databases, a majority of the databases that I use have ISSN fields which will suffice. for example qh 301 a2x. bioscience. 0006-3568 BISNA sf 810 a3 v4x. veterinary parasitology. 0304-4017 qd 1 a52x. journal of the american chemical society. 0002-8223 qa 76.6 a8a. acm transactions on mathematical software. 0098-3500 ta680 .a557. aci materials journal. 0889-325X ta680 .a556. aci structural journal.0889-3241 qa75.5 .a35. acm transactions on computer systems 0734-2071 qa3 .a23. acta arithmetica. AARIA 0065-1036 tl787 .i47. acta astronautica. 0094-5765 qb1 .a1715. acta astronomica. AASWA 0001-5237 qd450 .a25 acta chemica scandinavica. series a: 0302-4377 ACSAA qd901 .a25. acta crystallographica. section a, ACACB 0108-7673 qd901 .i523. acta crystallographica. section b, ACBCA 0108-7681 qa1 .h81. acta mathematica hungarica. ACMTA 0236-5962 qa1 .a18. acta mathematica. 0252-9602 ACMAA After you have unzipped fgrep172.zip and perl3.zip. Copy the fgrep.com and the perl.exe files to a directory specified in your path; for example you could copy the files to where your ms-dos files are (ie the format command and the like) then edit the file and call it jh.pl Then copy the jh.pl to the same directory where procomm resides, because this is where the procomm.log file will be. then after the search type the following perl jh.pl *if this no work, perl is NOT in your path; do a "path" at the c: prompt to see what your path is. --------------cut here for ms-dos version------------------ # jh.pl journalhunter # copyright dmahone@hal.unm.edu system ("cls"); # the line below is a safeguard, if someone searches and doesn't # display the ISSN or CODEN fields-otherwise you get the entire # local list of journals. system ("echo 9999-0000 >> procomm.log"); print "Checking local holdings--this may\n"; print "take a few minutes\n"; open(FILE,"procomm.log"); open(OUT1,">tip.out"); while () { # grabs lines that have either ISSN or CODEN and then trims line to # leave just the number and prints it to a file # that we will search if ($_ =~ /ISSN: /) { $_ = $'; if ($_ =~ /: /) { $_ = $';} if ($_ =~ / /) { $_ = $`;} print OUT1 "$_";} if ($_ =~ /CODEN: /) { $_ = $'; if ($_ =~ /: /) { $_ = $';} if ($_ =~ / /) { $_ = $`;} print OUT1 "$_";} } close(FILE); close(OUT1); open(OUT1,"tip.out"); open(OUT2,">tip.dan"); while () { #another safeguard here- if the line is long sometimes # after trimming the issn you get a blank line. #following code checks for blank lines and dumps them, # having fgrep search a blank line will bring the #whole local list tumbling down chop; $_ =~s/://; if ($_ ne "") {print OUT2 "$_\n";} } close(OUT2); open(OUT2,"tip.dan"); system ("fgrep -f tip.dan coden.two >> procomm.log"); print "Local journal holding will be appended to search log\n"; -----------------cut here for ms-dos version -------------------------- -------------provided you have perl on your vax-------------------------- -----------------cut here for unix version ------------------------------- #!/usr/bin/perl # if no work do a "which perl" to see where perl is located # on your vax. then change /usr/bin/perl to reflect it # also change some of the files names for unix # ie. procomm.log might be tip.record..... # jh.pl journalhunter # copyright dmahone@hal.unm.edu system ("clear"); # the line below is a safeguard, if someone searches and doesn't # display the ISSN or CODEN fields-otherwise you get the entire # local list of journals. system ("echo 9999-0000 >> procomm.log"); print "Checking local holdings--this may\n"; print "take a few minutes\n"; open(FILE,"procomm.log"); open(OUT1,">tip.out"); while () { # grabs lines that have either ISSN or CODEN and then trims line to # leave just the number and prints it to a file # that we will search if ($_ =~ /ISSN: /) { $_ = $'; if ($_ =~ /: /) { $_ = $';} if ($_ =~ / /) { $_ = $`;} print OUT1 "$_";} if ($_ =~ /CODEN: /) { $_ = $'; if ($_ =~ /: /) { $_ = $';} if ($_ =~ / /) { $_ = $`;} print OUT1 "$_";} } close(FILE); close(OUT1); open(OUT1,"tip.out"); open(OUT2,">tip.dan"); while () { #another safeguard here- if the line is long sometimes # after trimming the issn you get a blank line. #following code checks for blank lines and dumps them, # having fgrep search a blank line will bring the #whole local list tumbling down chop; $_ =~s/://; if ($_ ne "") {print OUT2 "$_\n";} } close(OUT2); open(OUT2,"tip.dan"); system ("fgrep -f tip.dan /u1/dmahone/coden.two >> procomm.log"); print "Local journal holding will be appended to search log\n"; ----------------- cut here for unix ----------------------------- The output will be appended to the capture.log DIALNET: call cleared by request Enter Service: 9999-0000 qb1 .a1715. acta astronomica. AASWA 0001-5237 tk7800 .i22. ieee trans on industrial electronics. 0278-0046 tk1 .i25. ieee trans on industry applications. 0093-9994 tk7800 .i4. ieee trans on power electronics. 0885-8993 qc1 .j83. journal of applied physics. JAPIA 0021-8979