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>