Importing records into MARC Report
This article is about adding single records to an existing MARC Report edit session.
In the past, the only way to do this was to copy the MARC record that you wanted to add, and then click on the Edit session window and press <F9>. This method is still supported and might be useful for 'screen-scaping' records from the LC catalog, or Z39.50 sites. The steps are:
- Find a record in the catalog
- Switch to a MARC view of the record
- Copy the record with the mouse1)
- Click on the edit session window and press <F9>
This method has problems, though; most displays are now in HTML, and HTML makes a mess of fixed fields (because it collapses repeated sequences of blank spaces).
If you have a source of records in files (one record in each file), there are better ways to import records.
Note: all of the options that are needed for the scenarios described below will be found on the 'Program Automation' page of the options.
Drag and Drop
MARC Report supports dragging and dropping MARC record files onto the Edit session window. The limitations are that the files must contain only one record. However, the program will accept any format that it recognizes: raw MARC, tagged text, marcBreaker, etc.
To enable this functionality, check the option named 'Accept records dropped on Edit sessions'.
How it works:
If the option above is enabled, when the edit session starts, it informs Windows that it will accept files that are dropped onto its window. You should see the mouse cursor respond appropriately during the drag and drop action.
Going back to the LC catalog example, the steps using drag and drop would be:
- Find a record in the LC catalog
- Use the 'Save …' option at the bottom of the screen and set the format to MARC
- Save the record to your desktop (the filename is record.mrc)
- Drag and drop 'record.mrc' onto your Edit session
Double-clicking
This is a variation on the above. Double-clicking on a MARC record file may be configured to add the record to an existing edit session instead of starting MARC Report.
To enable this functionality:
- Select the option named 'Accept records dropped on Edit sessions'.
- Make sure that the extension for the filename being double-clicked is associated with MARC Report
How it works:
Double-clicking a file associated with MARC Report attempts to launch the program in a new instance. The new instance checks to see if any other instances are running, and whether they have an edit session open that is accepting records. If so, the new instance sends the name of the double-clicked file to the other edit session, and then closes itself. The edit session in the other instance verifies the message from the instance started by the double-click, and if it checks out, imports the record.
Note that if no edit session is running, double-clicking a file associated with MARC Report will start the program and execute the action selected for 'Program start-up mode'. Also note that if the double-clicked file contains more than one record, a new session will be started regardless–the 'double-click import' works only for one record files.
Folder watch
This method is quite a bit different than the other two and is designed as a way for other applications to 'send' records to MARC Report. In this case the program is told to watch a specific folder on the system, and watch for files being addded to it. As soon as it recognizes a new record (in the guise of a new single-record file added to the watched folder), that record is added to the current edit session.
To enable this functionality,
- Select the option named 'Accept records sent to MARC Report'.
- Edit the marcreport.ini file to specify the folder being watched
How it works:
When the edit session starts, the program makes a list of all files in the watched folder, and starts a thread that watches for files being added to that folder. When a new file is detected, the thread signals the edit session to import the record.
To specify the folder that is being watched for files, set the
LISTENPATHBDS
option in the marcreport.ini file2). The path entered here should be fully-qualified and end in a backslash.
By default, the listener will accept only filenames that match the pattern
*.mrc
This pattern may be customized using the option
LISTENERFILESPEC
in the marcreport.ini file3).
Notes
The folder watcher will consider only files with a last modification date equal to the current date. Thus any older files in the folder will never be picked up.