NAME:
  xdesig
 PURPOSE:
  Digest and record Minor Planet Center designation cross references.
 DESCRIPTION:
  This program reads one or more files containing cross reference information
    from the Minor Planet Center.  These files contain pairs of columns where
    the first column in the pair has the internal name as reported to the MPC
    and the second column has the cross-reference designation returned by the
    MPC.

  Each object is located in the master cross reference file and then the
    object data is updated to indicate the proper linkage.  Before saving any
    changes, the file is copied to a file with a '.bak' appended to the file
    name.

 CATEGORY:
  Astrometry
 CALLING SEQUENCE:
  xdesig,fnlist,objectfile
 INPUTS:
  fnlist     - File name(s) to be read in with cross-references
  objectfile - File name of master cross references, default='newobj.dat'
 OPTIONAL INPUT PARAMETERS:

 KEYWORD INPUT PARAMETERS:
  SWAP - Flag, if set reverses the order of the cross reference list.  The
            normal order is to see a local designation in the first (or odd)
            columns and the provisional designation is in the second (or
            even) columns.  If this flag is set then the provisional
            designation comes first.
  OBLIST - File containing the list of pre-designation objects of interest.
               Default=/net/frakir/raid/buie/kbo/oblist.dat
             If the file exists, it is scanned and warnings are posted if
             an object is seen in oblist.dat that is also in the
             cross-reference files that are being processed.  Nothing is done
             by this program.  It's up to the user to do something with
             warning messages.
  NODB    - Flag, if set will suppress saving new codes to des.newobj database.

  NOSAVE  - Flag, if set will suppress any file or DB I/O to check program
             operation.  This is not intended for dry-runs, just for program
             debugging.

 OUTPUTS:

 KEYWORD OUTPUT PARAMETERS:

 COMMON BLOCKS:

 SIDE EFFECTS:

 RESTRICTIONS:

 PROCEDURE:

 MODIFICATION HISTORY:
  2000/05/03, Written by Marc W. Buie, Lowell Observatory
  2001/10/03, MWB, upgraded to LONG loop counters.
  2002/03/22, MWB, added SWAP keyword.
  2002/09/03, MWB, changed Str_sep call to strsplit
  2003/02/04, MWB, fixed minor bug in a warning statement
  2003/08/15, MWB, added NODB keyword and database storage to des.newobj
  2003/10/01, MWB, converted my Filecopy call to system file_copy routine
  2004/02/09, MWB, change path to oblist.dat file.
  2004/09/24, MWB, changed final file_copy to file_move for backup file
  2006/12/05, MWB, added NOSAVE keyword, the creation of a backup of
                      the newobj database, and suppress reposting
                      cross-references that have already been posted.
  2015/04/26, MWB, changed to collect up oblist warnings to the end