How to write a page break character.

From: Chetak Sasalu (chetak.sasalu_at_wipro.com)
Date: 12/20/03

  • Next message: Randy W. Sims: "Re: How to write a page break character."
    Date: Sat, 20 Dec 2003 13:07:18 +0530
    To: <ajey@pdx.edu>
    
    

    Hi,

    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?

    Thanks,
    Chetak
    -----Original Message-----
    From: Ajey [mailto:ajey@pdx.edu]
    Sent: Saturday, December 20, 2003 7:43 PM
    To: Douglas Lentz
    Cc: David Inglis; beginners@perl.org
    Subject: Re: how to remove a ^M charaters from a variable

    if its a unix file,.open in vi
    :%s/ctrl+v ctrl+m//g
    (where ctrl+v and ctrl+m gives the ^M character.)

    cheers

    On Fri, 19 Dec 2003, Douglas Lentz wrote:

    > David Inglis wrote:
    >
    > >I am reading in a csv file and it has a control character ^M at the
    > >end of each line how can I remove these charaters, I have tried the
    > >following and had no success.
    > >
    > >$a=~s/\^M//;
    > >$a=~s/^M//;
    > >
    > >
    > >Any help appreciated thanks.
    > >
    > >
    > >
    > >
    > This is an MS-DOSsy file, where each line is terminated by the famous
    > CR/LF combination. "^M" is the carriage return. Between the regex
    > slashes ("the jungle") "^" means "beginning of line", so what you have

    > instructed regex to do is erase any capital "M" that happens to occur
    at
    > the beginning of a line.
    >
    > If you have a copy of the program dos2unix around, it will take care
    > of
    > this for you, otherwise you can try $a =~ s/\x0D//;
    >
    > which means replace any CR you find with null. HTH.
    >
    >
    > --
    > To unsubscribe, e-mail: beginners-unsubscribe@perl.org
    > For additional commands, e-mail: beginners-help@perl.org
    > <http://learn.perl.org/> <http://learn.perl.org/first-response>
    >

    --
    To unsubscribe, e-mail: beginners-unsubscribe@perl.org
    For additional commands, e-mail: beginners-help@perl.org
    <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 Mailadmin@wipro.com immediately
    and destroy all copies of this message and any attachments.


  • Next message: Randy W. Sims: "Re: How to write a page break character."

    Relevant Pages

    • RE: help on nautilus-cd-burner
      ... If you need to make an image file to burn you can run this command: ... This message and any attachments are intended only for the use of the ... If the reader of the message is not the intended recipient, ... dissemination of this communication is strictly prohibited. ...
      (RedHat)
    • Re: Strange Problems/Any way to completely clear out an eTrex Vista?
      ... This email and any attachments may contain confidential material for the ... If you are not the intended recipient, ... Tech support request for eTrex Vista ...
      (sci.geo.satellite-nav)
    • Re: OT: Am I being Picky
      ... most of the inaccuracies that are foisted upon the viewer, ... the information in this message and/or attachments may contain protected ... health, legally privileged, or otherwise confidential information. ... the reader of this message, are not the intended recipient, you are hereby ...
      (uk.rec.engines.stationary)
    • Re: Kernel: Out of Memory: Killed process 5524 (httpd)
      ... I checked the crontab for anything that looked out of place. ... >> recipient, or the authorized agent of the intended recipient, you are ... If you have received this communication in error, ... >> message and any attachments from your system. ...
      (RedHat)
    • RE: Nagios Alternative?
      ... This message and any attachments are intended only for the use of the ... If the reader of the message is not the intended recipient, ... source package around. ... unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe ...
      (RedHat)