How can I get the final printed output of a text file that contains control characters?

StackOverflow https://stackoverflow.com/questions/9796794

  •  25-05-2021
  •  | 
  •  

سؤال

I have the output of a program that uses control characters to animate a progress bar. The output is in a text file. I would like to somehow obtain the final printed output that results from running cat on the text file, and put that result into a new text file. Is there any way to to this?

هل كانت مفيدة؟

المحلول

It turned out that in my case it was sufficient to delete the beginning of each line up to the last control character on that line, leaving only the final printed output of the line. This is not a general solution, though.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top