merrymonk has asked for the wisdom of the Perl Monks concerning the following question:
I need to analyse data used to control machine tool. A sample is shown below.
N335G03X247.16Y580.07K6.89J96.62H1M25 N340M20 N345G45 N350G01X832.56Y692.92C275.44M25 N355M20 N360G46C0 N365G03Y720.88I146.74J13.98H36M25
I need to find rows which have certain patterns. Some of the numbers are fixed others are variable. For example the first four rows can be written as (the variable numbers all are in a <> and some may be integers)
N<n>G03X<x>Y<y>K<k>J<j>H1M25 N<n>M20 N<n>G45 N<n>G01X<x>Y<y>C<c>M25
and I want to find the rows which match these descriptions.
I can see that regular expressions might well be able to do this but I am not sure how to start.
Therefore I would appreciate any pointers and possible examples which will help me to do this.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using regular expressions to find patterns in machine tool data
by Athanasius (Archbishop) on Jun 27, 2015 at 10:07 UTC | |
|
Re: Using regular expressions to find patterns in machine tool data
by FreeBeerReekingMonk (Deacon) on Jun 27, 2015 at 09:07 UTC | |
by GrandFather (Saint) on Jun 27, 2015 at 09:11 UTC | |
by AnomalousMonk (Archbishop) on Jun 27, 2015 at 16:07 UTC | |
|
Re: Using regular expressions to find patterns in machine tool data
by hexcoder (Curate) on Jun 27, 2015 at 09:22 UTC | |
|
Re: Using regular expressions to find patterns in machine tool data
by RichardK (Parson) on Jun 27, 2015 at 10:22 UTC | |
by merrymonk (Hermit) on Jun 27, 2015 at 11:25 UTC |