0

How do I convert carriage returns from a text file to the way they are displayed in console?

So for example, if a program prints the following lines to a console:

start\n
progress  01%\r
progress  22%\r
progress  54%\r
progress 100%\n
completed

after a time the output in the console will look like this:

start
progress 100%\n
completed

but if I pipe the output to a file it will contain all the intermediate progress reports.

Preferably some solution that can be applied to large log files >100 MB.

Jaakko
  • 340

1 Answers1

1

Tool called col seems to do the trick

col -bp <filename.log > fileout.log

Jaakko
  • 340