develooper Front page | perl.beginners | Postings from March 2002

Multiline searching -

Thread Next
From:
Steven M. Klass
Date:
March 12, 2002 08:01
Subject:
Multiline searching -
Message ID:
200203121600.g2CG0U207002@vivids1.nsc.com
Hi all,

	I have a text that broken into sections.  Each section has comments(;) and 
can be placed anywhere,  Each section ends with "*ENDS" .  Each section 
begins with a *KEYWORD, where keyword is any word like DESCRIPTION, 
OPERATION, FOO, AND BAR.  I want to read in this one section at a time.  I 
then want to work exclusively on one section(DESCRIPTION).  Can someone 
enlighten me a bit.  I want to know how to read this in by section (as oposed 
to line) that ends with (*ENDS).  Then I want to know how to tell what 
section I'm in (*DESCRIPTION), and then I want to know where to do my search 
and replace (s/INFILE/TEST/).  I hope someone can help me out.  Thanks so 
much for your continued patience!

Example Text
<snip>
; Test 
; Test
*DESCRIPTION
; More comments
INFILE = blach
OUTFILE = test
;

;
*ENDS
;
;
*LAYERS
LAYER=1
;
*ENDS
;
<snip>

-- 

 Steven M. Klass
 Physical Design Manager

 National Semiconductor Corp
 15210 S. 50th Street
 Suite 120, Mail Stop AZ4
 Phoenix, AZ 85044

 Ph:480-629-2503
 Fax:480-629-2476

 steven.klass@nsc.com
 http://www.nsc.com

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About