Hi, I have one more requirement, The last STATUS which occurs just prior to the file end should not be followed by a page break character. How can I code this in perl?
Thanks John! For giving me the fish and, more importantly, the fishing net(pod) :-D -Chetak -----Original Message----- From: John W. Krahn [mailto:[EMAIL PROTECTED] Sent: Saturday, December 20, 2003 3:33 PM To: [EMAIL PROTECTED] Subject: Re: How to write a page break character. Chetak Sasalu wrote: > > Hi, Hello, > I want to search for the word "status" in a group of files in a > directory and replace it with "status\n^L" where ^L is a page break > chatacter, In vi I can type it in using cntrl+l. > > I want to do this by > > perl -p -i.old -e 's/^STATUS$/STATUS\n(page break character)/' * > > How can I "write" the page break character (^L) on command line? Both perlop.pod and perlre.pod list the escape sequences that Perl (and C) use for printing control characters. perl -i.old -pe's/^STATUS$/STATUS\n\f/' * Or: perl -i.old -pe's/^STATUS$/STATUS\n\cL/' * Or: perl -i.old -pe's/^STATUS$/STATUS\n\014/' * Or: perl -i.old -pe's/^STATUS$/STATUS\n\x0C/' * John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response> Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>