Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Matching range of text with another string in between

by Anonymous Monk
on Apr 26, 2016 at 13:29 UTC ( [id://1161547]=note: print w/replies, xml ) Need Help??


in reply to Matching range of text with another string in between

perl -ne "BEGIN{print scalar <> for 1..14} END{print +(split /^/, $x)[ +-3..-1]} $x = $x x !/\QLX*/ . $_; /\QCAS*\E/ && print $x x $x =~ /000 +03/" "filename"

Replies are listed 'Best First'.
Re^2: Matching range of text with another string in between
by periodicalcoder (Novice) on Apr 27, 2016 at 21:29 UTC

    This works perfectly! Thank you for your patience and I can't adequately say how much I appreciate your help. I expect project creep with this but hopefully I'll be able to handle the rest on my own.

    Thank you all for your help!

      Thanks for letting me know it worked. Also, thanks for the interesting problem. :)

      Also, in the future, details like the first 14 lines and the last 3 should be mentioned up front, because code can be very sensitive to such seemingly small requirements.

        Yes, I will be sure to do so. I realized that myself after the first reply or two.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1161547]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-03-29 14:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found