Pattern substitution

Discussion in 'Perl Misc' started by rschroe@gmail.com, Feb 3, 2006.

  1. Guest

    Can anyone explain this command to me?


    A file is passed to this command and the output piped to a file.


    perl -pe 's/\e&k[0-9]S\e&l[0-9]H\eE//'


    What it seems to do is cut everything between the first / and the
    second /, but can't quite get the sense of what is being cut.


    Thanks for your help


    RCS
    , Feb 3, 2006
    #1
    1. Advertising

  2. Jim Gibson wrote:
    > \e is the metasymbol for the escape character, so it looks like it is
    > removing escape sequences such as escape-&-k-0-S and escape-&-l-9-H. I
    > don't know what the sequences \e&k0S through \e&k9S or \e&l0H through
    > \e&l9H do, but \eE is the ANSI escape sequence for "Next Line". ANSI


    They are PCL escape sequences used to control printer output.
    Most likely the file was created by a "Print to File" command
    within an application.

    --
    brian
    Brian Helterline, Feb 3, 2006
    #2
    1. Advertising

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. Vibha Tripathi

    Regular Expression for pattern substitution

    Vibha Tripathi, Jul 1, 2005, in forum: Python
    Replies:
    3
    Views:
    304
    Devan L
    Jul 1, 2005
  2. Daniel Mircea

    Pattern based substitution

    Daniel Mircea, Oct 16, 2006, in forum: Ruby
    Replies:
    0
    Views:
    77
    Daniel Mircea
    Oct 16, 2006
  3. Sarah Allen

    gsub pattern substitution and ${...}

    Sarah Allen, May 11, 2009, in forum: Ruby
    Replies:
    7
    Views:
    103
    Sarah Allen
    May 11, 2009
  4. Arturi
    Replies:
    8
    Views:
    115
    Anno Siegel
    Apr 5, 2005
  5. Vorxion

    utf8 issue with substitution pattern

    Vorxion, Apr 19, 2005, in forum: Perl Misc
    Replies:
    0
    Views:
    109
    Vorxion
    Apr 19, 2005
Loading...

Share This Page