character encoding - How can I save Perl/Expect output that contains mixed ascii content? -



character encoding - How can I save Perl/Expect output that contains mixed ascii content? -

i have perl script uses expect library login remote system. i'm getting final output of interaction before method:

$exp->before();

i'm saving text file. when utilize cat on file outputs fine in terminal, when open text file in editor or seek process formatting bizarre:

[h[2j[1;19hcirculation activity terminal (nov 6,14)[11;1h

is there improve way save output?

when run enca it's identified as:

7bit ascii characters

surrounded by/intermixed non-text data

you can remove none ascii chars.

$str1 =~ s/[^[:ascii:]]//g; print "$str1\n";

perl character-encoding expect text-processing

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -