Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Text file filtering

by bwana147 (Pilgrim)
on Jun 27, 2002 at 15:40 UTC ( [id://177733]=note: print w/replies, xml ) Need Help??


in reply to Text file filtering

IIUC, the headers stand on a line by themselves. Then, you might want to have a look at the flip-flop operator (..).

perldoc perlop

while ( <> ) { if ( /\(\+Header1\)/ .. /\(-Header1\)/ ) { # you're in part one } if ( /\(\+Header2\)/ .. /\(-Header2\)/ ) { # you're in part two } if ( /\(\+Header3\)/ .. /\(-Header3\)/ ) { # you're in part three } }

HTH

--bwana147

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-04-24 06:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found