Skip to content

Instantly share code, notes, and snippets.

@DineshSolanki
Last active March 22, 2023 13:57
Show Gist options
  • Save DineshSolanki/dfc638674c7777bb8bf8891e64377f59 to your computer and use it in GitHub Desktop.
Save DineshSolanki/dfc638674c7777bb8bf8891e64377f59 to your computer and use it in GitHub Desktop.
remove ansi escape code from log files
sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" input_file > output_file
(Get-Content input_file) -replace "\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]", "" | Set-Content output_file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment