[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Support #SCJ-652679]: ldm question



Hi Michael,

re:
> Sorry Steve, I didn't explain well.  I want to receive the product but I want
> it to be processed only by the file name, not by the path as well.  In the
> example below, the file awdnmet....txt has only the file name.  In the next
> entry for the .dat file, the entire path is a part of the file name.  How do I
> get rid of the path and keep just the file name?

What you want to do is craft a pattern-action file entry that extracts and
uses the file name portion from the product header.

If it is the case that all products that have the '.dat' suffix also have
the directory portion of the fully qualified pathname, then you can separate
your existing action into two mutually-exclusive actions.  For instance,
suppose that the following is the pattern you have now:

EXP   (.*)
   FILE   -close
   data/\1

Split this into two mutually exclusive patterns as follows:

EXP   (.*)\.txt$
   FILE   -close
   data/\1.txt

EXP   ([^/]*)\.dat$
   FILE   -close
   data/\1.dat

If all of the products in question end in '.dat' or '.txt', then
the following single entry should work:

EXP   ([^/]*)\.(dat|txt)$
   FILE   -close
   data/\1.\2

NB:

- the white space shown in the examples above are all tabs

- adjust your entries to use the feedtype for your data

- after adding or modifying a pattern-action file entry,
  _always_ check to make sure that you have not introduced
  a syntax error:

  <as 'ldm'>
  ldmadmin pqactcheck

  If 'ldmadmin pqactcheck' indicates an error, re-edit your
  pattern-action file to correct the error.

- as soon as 'ldmadmin pqactcheck' does not complain of
  gross syntax errors in your pattern-action file, and if
  your LDM is running, send a HUP signal to tell 'pqact'
  to re-read your pattern-action file actions:

  <as 'ldm'>
  ldmadmin pqactHUP

Cheers,

Tom
--
****************************************************************************
Unidata User Support                                    UCAR Unidata Program
(303) 497-8642                                                 P.O. Box 3000
address@hidden                                   Boulder, CO 80307
----------------------------------------------------------------------------
Unidata HomePage                       http://www.unidata.ucar.edu
****************************************************************************


Ticket Details
===================
Ticket ID: SCJ-652679
Department: Support LDM
Priority: Normal
Status: Closed