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

Modifying/Additng text in a file

Thread Next
From:
pn
Date:
January 31, 2002 06:13
Subject:
Modifying/Additng text in a file
Message ID:
20020131140445.34098.qmail@web20105.mail.yahoo.com
I have a file whose contents are of the form :

NET_A OUTPUT (
   REQUIRED (
      _UP %0.093 BR CLK
      _DN %0.093 BR CLK
   )
)

NET_B OUTPUT (
   REQUIRED (
      _UP %0.093 BR CLK
      _DN %0.093 BR CLK
   )
)


I would like to read in this file in and modify the
contents to be as follows :

NET_A OUTPUT (
   REQUIRED (
      _UP %0.093 BR CLK
      _DN %0.093 BR CLK
   )

ABC = 1.1            // Insert this expression
)

NET_B OUTPUT (
   REQUIRED (
      _UP %0.093 BR CLK
      _DN %0.093 BR CLK
   )
ABC = 1.1          //  Insert this expression
)

Any pointer on how to accomplish this would be greatly
appreciated. Could this be accomplished by using a
regexp ?

Thanks

PN



__________________________________________________
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.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