C
Chris
I need help in trying to match something from a list. The list
consist of many lines. Once I get the match I want to extract a
number from it (no starting zeros) and place that value in $1 by using
parentheses. Can you help?
Here is an example of the list with as many possible variations I
could think of:
_CCCRM_01 nm7fg.gdf.cfg
_CCCRM_02 n8ehg.ghd.cfg
_CCCRM_10 nmgft.fhe.cfg
_CCCRM_11 cd6ls.ty4.cfg
_CCCRM_12 ntew3.ghe.cfg
_CCCRM_21 dgw42.t3j.cfg
Things that are consistant in the pattern: periods, underscores,
CCCRM, cfg
I need to store in $1 the number from CCCRM. i.e. the 21 from
_CCCRM_21
If there is a 0 in left placement it needs to be dropped.
This is what I thought that works, but doesn't:
_CCCRM_0?(/d+)/b/s/b.+\..+\.cfg
Can you help me?
-Chris
consist of many lines. Once I get the match I want to extract a
number from it (no starting zeros) and place that value in $1 by using
parentheses. Can you help?
Here is an example of the list with as many possible variations I
could think of:
_CCCRM_01 nm7fg.gdf.cfg
_CCCRM_02 n8ehg.ghd.cfg
_CCCRM_10 nmgft.fhe.cfg
_CCCRM_11 cd6ls.ty4.cfg
_CCCRM_12 ntew3.ghe.cfg
_CCCRM_21 dgw42.t3j.cfg
Things that are consistant in the pattern: periods, underscores,
CCCRM, cfg
I need to store in $1 the number from CCCRM. i.e. the 21 from
_CCCRM_21
If there is a 0 in left placement it needs to be dropped.
This is what I thought that works, but doesn't:
_CCCRM_0?(/d+)/b/s/b.+\..+\.cfg
Can you help me?
-Chris