Skip to main content

Thread: Saving output without control characters


i have text log file has copy of typed on console. when cat file show me likes of:

server1:>ls
server1:>who
server1:>top


...and on.

if either cat -v or vi file following:

server1:>ll^hs^m
server1:>which^h^h^h^h^hwho^m
server1:>tap^h^hop^m


obvious ^h control character backspace , ^m return - both of translated cat final command executed shown , not errors (plus backspaces/enters).

easy enough rid of ^m through sed or tr, how around ^h characters?

if type in:

server1:>grep top outputfile.txt

(where outputfile.txt has above 3 commands in it), not show me last line of server1:>top since actual output server1:>tap^h^hop^m

makes difficult manipulate data in text file since file not "true" text combination of text , control characters:

server1:>file outputfile.txt
outputfile.txt: ascii text, crlf line terminators, overstriking


there way can cat of file , redirect file, file looking same stdout (console/xterm)?

if try do:

server1:>cat outputfile.txt > newfile.txt

left original control characters, makes viewing in vi or parsing grep difficult. somewhere between cat , console control characters interpreted rather displayed....something cannot seem replicate!

suggestions?

try

col -b <input_file


Forum The Ubuntu Forum Community Ubuntu Official Flavours Support General Help [all variants] Saving output without control characters


Ubuntu

Comments

Popular posts from this blog

Thread: PKI Client 5.00 install (for eToken Pro)

ATmega2560-Arduino Pin Mapping

Crossfader Arduino Tutorial