LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-07-2011, 11:36 AM   #1
casperdaghost
Member
 
Registered: Aug 2009
Posts: 349

Rep: Reputation: 16
CTRL -A representations in Linux terminal log output


i have a log file and instead of spaces it has a box with three zeros and a one inbetween the integers

picture the below surrounded by a box - very small, numbers though - the whole thing is only about as big as the monspaced integer.
Code:
00
01
I am pretty sure that these are CRTL-A characters.
i am trying to cat the log file and use sed to take them out, but it is not working -

sed 's/\0001/ /g'

I even tried hitting a CRTL -A manually in the sed replace, but that is not working either -

anybody ever see thse in s alog file
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 11-07-2011, 11:45 AM   #2
casperdaghost
Member
 
Registered: Aug 2009
Posts: 349

Original Poster
Rep: Reputation: 16
when i open up the file in vi they are each translated in to ^A
 
Old 11-08-2011, 06:33 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,258

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
Tell us which logfile and provide a few lines for us to look at (in code tags).
 
Old 11-09-2011, 12:13 PM   #4
SecretCode
Member
 
Registered: Apr 2011
Location: UK
Distribution: Kubuntu 11.10
Posts: 562

Rep: Reputation: 102Reputation: 102
Code:
sed 's/\x01/ /g'
may do it
 
Old 11-09-2011, 01:42 PM   #5
casperdaghost
Member
 
Registered: Aug 2009
Posts: 349

Original Poster
Rep: Reputation: 16
Here ya go - the littel boxes disappear on the code box - however if you open this upin a linux terminal, you will see a box between each value. it is ctrl-a separated
Code:
<8=FIX.4.29=00013335=D57=S56=INET49=MLCORZ34=2000752=20111104-16:13:4921=1114=N47=P11=BBK627255=AAPL59=544=140=238=50054=118=N76=SAVE10=009
>8=FIX.4.29=020835=834=949=INET56=MLCORZ52=20111104-16:13:4911=BBK627237=0109=MLCO17=-120=0150=039=055=AAPL54=138=50059=532=031=0.0151=50014=06=0.018=N44=1.000040=247=P29=476=SAVE58=Open198=1183310=166
<8=FIX.4.29=00013135=G57=S56=INET49=MLCORZ34=2000852=20111104-16:13:5411=BBK627455=AAPL44=140=238=20054=141=BBK627260=20111104-16:13:5410=175

Last edited by casperdaghost; 11-09-2011 at 01:43 PM.
 
Old 11-09-2011, 02:03 PM   #6
SecretCode
Member
 
Registered: Apr 2011
Location: UK
Distribution: Kubuntu 11.10
Posts: 562

Rep: Reputation: 102Reputation: 102
Which logfile? Which program is writing these lines?
 
Old 11-09-2011, 02:08 PM   #7
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958
The symbol you're seeing sounds like a unicode replacement symbol, displayed by some programs when the font doesn't support the current character or it's otherwise unrenderable. The numbers inside correspond to that character's unicode codepoint.

SecretCode's sed command appears to handle them, at least if it's gnu sed. You could also use bash's $'' quoting feature (ref: the quoting section of the manpage), with something like tr.

Code:
tr -d $'\x01' <oldfile >newfile
This removes them entirely. You could replace them with a new character instead, of course.

Edit: And here's a description of the replacement character, called the Unicode BMP Fallback:

http://en.wikipedia.org/wiki/Unicode_fallback_font

Last edited by David the H.; 11-09-2011 at 02:14 PM. Reason: some rewording
 
2 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
emacs in a terminal : problems with ctrl Willard Linux - Software 5 09-13-2011 05:18 PM
ctrl+c & ctrl+v equivalent for Gnome terminal window? halfpower Linux - General 2 11-29-2005 03:57 AM
Console Terminal (Ctrl-F1) ieduarte73 Linux - Newbie 1 08-30-2005 06:43 PM
How to direct output both log file and to terminal... freebies Linux - General 1 02-25-2005 07:32 AM


All times are GMT -5. The time now is 01:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration