Re: Pattern Matching/Saving to Lower Case

Hi Jim,

> I'm now capturing NIDS data via ldm from one of my NOAAPORT systems and
> my pqact.conf entry is as follows:
> 
> # Store NIDS radar
> #
> ANY     ^SD..5. .(...) ([0-3][0-9])([0-2][0-9])([0-5][0-9]).*
> /p(...)(...)
>         STDIOFILE       /huge/nids/\1/(\2:yy)(\2:mm)\2\3\4_\5.nid
> 
> This is working and giving me headers under a given station's directory
> as
> 
> 0108211917_NCR.nid      0108211917_NVL.nid      0108211922_N0S.nid
>       
> However, I'd like to have all product type letters in lower case, e.g.
> 
> 0108211917_ncr.nid      0108211917_nvl.nid      0108211922_n0s.nid
> 
> Is there an easy way to do this way to make with pattern matching? I
> can't seem to put my finger on anything in searching the ldm archives or
> site manager's guide.

No, there is currently no easy way to do this with pattern matching.
We would need to create new syntax for this, something like

 (\5:lower)

to substitute the fifth matched field converted to lower case, much
like the current date substitution (\5:yyyy) substitutes the year
corresponding to the day-of-month represented by the fifth matched
field.

The code to do this would all be in the LDM source file
"src/pqact/palt.c" and would involve the addition of a fairly small
case_sub() function modeled after the current date_sub() function in
that file.  I'm just suggesting an implementation because if you need
this functionality immediately, it may be faster to add it as a local
modification than to wait until we it gets into a future release.

--Russ

_____________________________________________________________________

Russ Rew                                         UCAR Unidata Program
russ@xxxxxxxxxxxxxxxx                     http://www.unidata.ucar.edu