GENWiki

Premier IT Outsourcing and Support Services within the UK

User Tools

Site Tools


computerfaq:strip_ansi_codes_from_a_text_file

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

computerfaq:strip_ansi_codes_from_a_text_file [2022/07/13 11:13] – created genadmincomputerfaq:strip_ansi_codes_from_a_text_file [2022/07/13 11:14] (current) genadmin
Line 6: Line 6:
 Stripping this is fairly easy and we'll do it with sed... Stripping this is fairly easy and we'll do it with sed...
  
-<code bash [enable_line_numbers="false"]>cat yourlogfile.log |sed -e 's/\x1b\[[0-9;]*m//g' > newlogfile.log</code>+<code shell [enable_line_numbers="false"]>cat yourlogfile.log |sed -e 's/\x1b\[[0-9;]*m//g' > newlogfile.log</code>
  
 Here we're taking the encoded logfile, passing it through sed which will strip out the ANSI codes, and then putting it back in a new log file.  Here we're taking the encoded logfile, passing it through sed which will strip out the ANSI codes, and then putting it back in a new log file. 
/home/gen.uk/domains/wiki.gen.uk/public_html/data/pages/computerfaq/strip_ansi_codes_from_a_text_file.txt · Last modified: 2022/07/13 11:14 by genadmin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki