Coastal & Marine Geology InfoBank

Home FACS Activities Atlas Geology School Related Sites More

USGS InfoBank program -- changeactivity

Skip navigational links
Loading
InfoBank Programs: by Name   by Topic  
Expanded Description
Topic Description
Name
changeactivity
Synopsis
/infobank/programs/util/changeactivity/changeactivity.for
Description
  Program to change an Activity ID.

       
AUTHOR
  Clint Steele     2/11/2008


    
Reads
      read (5, '(q,a)', end = 99)
     *    OldIDLength, OldShortID(1:OldIDLength)
      read (5, '(q,a)', end = 99)
     *    NewIDLength, NewShortID(1:NewIDLength)
          read (90, '(q,a)', end = 98)
     *        OldFileLength, OldFile(1:OldFileLength)
Writes
      write (85, '(a)')
     *    'changed '//CapOldLongID(1:OldIDLength+3)//
     *    ' to '//CapNewLongID(1:NewIDLength+3)
Opens
      open (unit = 90,
     *      access = 'sequential',
     *      form = 'formatted',
     *      status = 'old',
     *      name = '/infobank/tmp/changeactivity.filelist.temp')
      open (unit = 85,
     *      access = 'append',
     *      form = 'formatted',
     *      status = 'unknown',
     *      file = '/infobank/programs/keep/changedactivities.keep')
Calls
      call changecase ('SMALL', OldShortID(1:OldIDLength))
      call changecase ('CAPITAL', CapOldShortID(1:OldIDLength))
      call changecase ('SMALL', NewShortID(1:NewIDLength))
      call changecase ('CAPITAL', CapNewShortID(1:NewIDLength))
      call changecase ('CAPITAL', CapOldLongID(1:OldIDLength+3))
      call changecase ('CAPITAL', CapNewLongID(1:NewIDLength+3))
      call system ('/bin/find /infobank/'//
     *             OldShortID(1:1)//'/'//
     *             OldShortID(1:OldIDLength)//'*/* -ls > 
     *             '/infobank/tmp/changeactivity.filelist.temp')
          call system ('/bin/cat '//
     *        OldFile(Slash:OldFileLength)//' | '//
     *        'sed -e s/'//
     *        OldLongID(1:OldIDLength+3)//'/'//
     *        NewLongID(1:NewIDLength+3)//'/g | '//
     *        'sed -e s/'//
     *        CapOldLongID(1:OldIDLength+3)//'/'//
     *        CapNewLongID(1:NewIDLength+3)//'/g | '//
     *        'sed -e s/'//
     *        OldShortID(1:OldIDLength)//'/'//
     *        NewShortID(1:NewIDLength)//'/g | '//
     *        'sed -e s/'//
     *        CapOldShortID(1:OldIDLength)//'/'//
     *        CapNewShortID(1:NewIDLength)//'/g > 
     *        '/infobank/tmp/changeactivity.'//
     *        NewShortID(1:NewIDLength)//'.temp')
              call system ('/bin/mv '//
     *            '/infobank/tmp/changeactivity.'//
     *            NewShortID(1:NewIDLength)//'.temp '//
     *            OldFile(Slash:Slash+OldIDLocation-2)//
     *            NewLongID(1:NewIDLength+3)//
     *            OldFile(Slash+OldIDLocation+OldIDLength+2:
     *            OldFileLength))
              call system ('/bin/rm '//
     *            OldFile(Slash:OldFileLength))
      call system ('/bin/mv '//
     *    '/infobank/'//
     *    OldShortID(1:1)//'/'//OldShortID(1:OldIDLength)//' '//
     *    '/infobank/'//
     *    NewShortID(1:1)//'/'//NewShortID(1:NewIDLength))
      call system ('/bin/rm /infobank/tmp/changeactivity.'//
     *    NewShortID(1:NewIDLength)//'.temp')

Skip footer navigational links

Coastal and Marine Science Centers:  Pacific   St. Petersburg   Woods Hole  
InfoBank   Coastal and Marine Geology Program   Geologic Information   Ask-A-Geologist   USGS Disclaimer  


Accessibility FOIA Privacy Policies and Notices

Take Pride in America logo USA.gov logo U.S. Department of the Interior | U.S. Geological Survey
URL: http://walrus.wr.usgs.gov/infobank/programs/util/changeactivity/changeactivity.doc.html
Page Contact Information: InfoBank staff
Page Last Modified: Mon Sep 16 03:37:04 PDT 2013  (chd)