Re: matching certain lines

2013-02-09 Thread Uri Guttman
On 02/09/2013 03:59 PM, John W. Krahn wrote: Let's re-factor that down to its essence: while ( ) { print if /\|68\|/; print "$1\t$2\t$3\n" if /(\|\d)\|(\d+)\|(\d+)/; } Now we need to add something that starts at |68| and stops at #END: while ( ) { if ( /\|68\|/ .. /^#EN

Re: matching certain lines

2013-02-09 Thread timothy adigun
Hi, On Sat, Feb 9, 2013 at 6:06 PM, Chris Stinemetz wrote: > I would like to only work with the data that has a line with |68| in it > Does it mean even, that |68| can be anyway in the your data before any of the #END is reached? If yes, then I think you have been given a good solution. If not,

Re: matching certain lines

2013-02-09 Thread John W. Krahn
Chris Stinemetz wrote: I would like to only work with the data that has a line with |68| in it print that line and then print each subsequent lines in that match /\|7\|\d+\|\d+/ until #END is reached and then repeat for the rest of the input data. Below is what I have attempted. Thanks in adva

Re: matching certain lines

2013-02-09 Thread David Precious
On Sat, 9 Feb 2013 11:06:46 -0600 Chris Stinemetz wrote: > I would like to only work with the data that has a line with |68| in > it print that line and then print each subsequent lines in that match > /\|7\|\d+\|\d+/ until #END is reached and then repeat for the rest of > the input data. OTTOMH

matching certain lines

2013-02-09 Thread Chris Stinemetz
I would like to only work with the data that has a line with |68| in it print that line and then print each subsequent lines in that match /\|7\|\d+\|\d+/ until #END is reached and then repeat for the rest of the input data. Below is what I have attempted. Thanks in advance. Chris #!/usr/bin/p