...followup for the mailing list archive,

I ended up blending a Perl one-liner that strips the ANSI color codes with the 
‘col -b’ suggestion.
(see also 
http://unix.stackexchange.com/questions/4527/program-that-passes-stdin-to-stdout-with-color-codes-stripped
 )

This works for what I needed:

cat original.log |perl -pe 's/\e\[[\d;]*m//g' |col -xb >./new.log

Thanks to all for the thoughts and suggestions!

--Craig Constantine, http://constantine.name


On May 30, 2014, at 2:12 PM, Brandon Allbery <[email protected]> wrote:

On Fri, May 30, 2014 at 1:47 PM, craig constantine <[email protected]> 
wrote:
I may resort to experimenting with something like having Perl read() and then 
print() each logical line to see if I can get the inbuilt print() to consume 
the things like backspaces at least.

Anyone have any other thoughts? (…two great ones so far! :)

I don't know of anything that captures the "rendered form" of ANSI terminal 
traces. You can do various parts of it fairly easily (col -b, removal of the 
mostly-rationalized ANSI escape sequences, etc.) --- but autoremoval of the 
completion stuff will be difficult at best. Best bet might be to do use that 
putty setting that was suggested --- and then start a capture and `cat` the 
original capture so putty can capture the rendered version.

-- 
brandon s allbery kf8nh                               sine nomine associates
[email protected]                                  [email protected]
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

_______________________________________________
Discuss mailing list
[email protected]
https://lists.lopsa.org/cgi-bin/mailman/listinfo/discuss
This list provided by the League of Professional System Administrators
 http://lopsa.org/

Reply via email to