what are they ^Y, ^S, etc?

Discussion in 'Perl Misc' started by bing, Aug 2, 2005.

  1. bing

    bing Guest

    I have a text file which was generated on Windows but needs to be
    parsed on linux by a Perl script. The file contains some strange chars
    some of which I know their meanings, like ^M is \r and ^K is Vertical
    Tab, but some I don't, like ^Y and ^S. The Perl script should get rid
    of these strange chars.

    Anybody know what ^Y and ^S are? Better even where can I find the
    definitions of these chars?

    I'd appreciate any help,

    Bing
     
    bing, Aug 2, 2005
    #1
    1. Advertisements

  2. bing

    Guest

    bing wrote:
    > I have a text file which was generated on Windows but needs to be
    > parsed on linux by a Perl script. The file contains some strange chars
    > some of which I know their meanings, like ^M is \r and ^K is Vertical
    > Tab, but some I don't, like ^Y and ^S. The Perl script should get rid
    > of these strange chars.
    >
    > Anybody know what ^Y and ^S are? Better even where can I find the
    > definitions of these chars?
    >
    > I'd appreciate any help,
    >
    > Bing




    $ perl -Mcharnames=:full -le '($a="a") =~ tr/a/\cS/; print
    charnames::viacode(ord($a));'
    DEVICE CONTROL THREE


    $ perl -Mcharnames=:full -le '($a="a") =~ tr/a/\cY/; print
    charnames::viacode(ord($a));'
    END OF MEDIUM


    As far as removing these characters, see:

    perldoc -f tr

    --
    Hope this helps,
    Steven
     
    , Aug 2, 2005
    #2
    1. Advertisements

  3. bing

    John Bokma Guest

    "bing" <> wrote:

    > I have a text file which was generated on Windows but needs to be
    > parsed on linux by a Perl script. The file contains some strange chars
    > some of which I know their meanings, like ^M is \r and ^K is Vertical
    > Tab, but some I don't, like ^Y and ^S. The Perl script should get rid
    > of these strange chars.
    >
    > Anybody know what ^Y and ^S are? Better even where can I find the
    > definitions of these chars?


    If ^M = \r = 13 you can get the codes of the other ones.

    See http://www.asciitable.com/


    --
    John Small Perl scripts: http://johnbokma.com/perl/
    Perl programmer available: http://castleamber.com/
    Happy Customers: http://castleamber.com/testimonials.html
     
    John Bokma, Aug 2, 2005
    #3
  4. bing wrote:

    > I have a text file which was generated on Windows but needs to be
    > parsed on linux by a Perl script. The file contains some strange chars
    > some of which I know their meanings, like ^M is \r and ^K is Vertical
    > Tab, but some I don't, like ^Y and ^S. The Perl script should get rid
    > of these strange chars.
    >
    > Anybody know what ^Y and ^S are? Better even where can I find the
    > definitions of these chars?
    >
    > I'd appreciate any help,
    >
    > Bing


    OT way to do it.
    Following has been tested on FreeBSD.

    col -bx < _file_ > _file_.new

    Regards,
    Shantanoo
     
    ????? ????? (Shantanoo Mahajan), Aug 11, 2005
    #4
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Asfand Yar Qazi
    Replies:
    4
    Views:
    458
    Asfand Yar Qazi
    Nov 12, 2004
  2. Martin M.
    Replies:
    4
    Views:
    388
    Simon Brunning
    Dec 15, 2005
  3. Dave Rudolf
    Replies:
    1
    Views:
    350
    Kai-Uwe Bux
    May 17, 2006
  4. Kevin Walzer

    Re: PIL (etc etc etc) on OS X

    Kevin Walzer, Aug 1, 2008, in forum: Python
    Replies:
    4
    Views:
    502
    Fredrik Lundh
    Aug 13, 2008
  5. David A. Black
    Replies:
    2
    Views:
    259
    Tim Hunter
    Aug 19, 2004
Loading...

Share This Page