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

20051116: regex expression problems in pqact



>From: Gerry Creager N5JXS <address@hidden>
>Organization: Texas A&M University -- AATLT
>Keywords: 200511161527.jAGFRr7s026324 LDM regular expressions

Hi Gerry,

re:
>We're looking at some incoming files with a filename like:
>SADCec95-UNC_WNAMAW32-NCP_20051116T0000_20051115T0000_20051119T1200_elev_Z-ELE
> .shp.gz
>and trying to parse same with a regex in pqact.scoop that looks like:
>EXP 
>^SADC(....)-UNC_(........-...)_([12][0-9][0-9][0-9])([01][0-9])([0-3][0-9])T(.
> *)_ZGIS-ELE\.(shp|shx|dbf)\.gz
>         FILE    -overwrite 
>data/SCOOP/GIS/ADCIRC/ele/SADC\1-UNC_\2_\3\4\5T\6_ZGIS-ele.\7.gz

The last set of parentheses will be used to match on 'shp', 'shx', and
'dbf'.  I don't think that it will evaluate into '\7'.  For this to
work I think you will need an additional level of parenthesis around
that clause:

EXP     
^SADC(....)-UNC_(........-...)_([12][0-9][0-9][0-9])([01][0-9])([0-3][0-9])T(.*)_ZGIS-ELE\.((shp|shx|dbf))\.gz
        FILE    -overwrite 
        data/SCOOP/GIS/ADCIRC/ele/SADC\1-UNC_\2_\3\4\5T\6_ZGIS-ele.\7.gz

Without the extra level of parenthesis, you only have 6 replacement fields
and you are trying to use 7.

>EXP 
>^SADC(....)-UNC_(........-...)_([12][0-9][0-9][0-9])([01][0-9])([0-3][0-9])T(.
> *)_ZGIS-ELE\.(shp|shx|dbf)\.gz
>         EXEC    /bin/gzip -fd 
>data/SCOOP/GIS/ADCIRC/ele/SADC\1-UNC_\2_\3\4\5T\6_ZGIS-ele.\7.gz
>ldmd.log says it's coming in.  I'm not seeing these written to the data 
>directory I *think* I'm putting them to.
>
>Suggestions would be greatly appreciated.  I suspect a problem in regex.

The easiest way to troubleshoot regular expressions you want to use in
either ldmd.conf of pqact.conf is to use the LDM utility 'notifyme'.
Take the regular expression you think is OK (without some of the
parentheses) and use it as the value of the '-p' (pattern) flag in a
notifyme invocation.

A 'notifyme' invocation using your first regular expression would then
look like:

<as 'ldm'>
notifyme -vxl- -f EXP -o 3600 -p 
"^SADC....-UNC_........-..._[12][0-9][0-9][0-9][01][0-9][0-3][0-9]T.*_ZGIS-ELE\.(shp|shx|dbf)\.gz"

I hope that this helps...

Cheers,

Tom
--
NOTE: All email exchanges with Unidata User Support are recorded in the
Unidata inquiry tracking system and then made publicly available
through the web.  If you do not want to have your interactions made
available in this way, you must let us know in each email you send to us.