log file problem

Hi,

I have a problem with my logfile. I am redirecting my output to log file and when iam viewing as text doc it is looking with some nonsense characters...please do help me on this .thank you.

here is my logfile which it is showing different behaviour:

spawn [open ...] 
spawn minicom 

Welcome to minicom 2.4 
 
OPTIONS: I18n  
Compiled on Jun  3 2010, 13:46:31. 
Port /dev/ttyS0 
 
Press CTRL-A Z for help on special keys 
 
   
ETH-T1> add/user=name,password 
 
Cant accept reserved characters in your command 
 
 
[23;80H [24;1H 
[23;80H [24;1HETH-T1> 
[23;80H [24;1H 
[23;80H [24;1HETH-T1>add\user=name,password 
[23;80H [24;1H 
[23;80H [24;1HCant accept reserved characters in your command 
[23;80H [24;1H 
[23;80H [24;1H 
[23;80H [24;1H 
[23;80H [24;1HETH-T1> 
[23;80H [24;1H 
[23;80H [24;1HETH-T1>DELETE/USER=name,password 
[23;80H [24;1H 
[23;80H [24;1HUnknown OAM Command:"DELETE/USER=name,password" 
[23;80H [24;1H 
[23;80H [24;1H 
[23;80H [24;1H 
[23;80H [24;1HETH-T1>add?user=name,password 
[23;80H [24;1H 
[23;80H [24;1HUnknown OAM Command:"add?user=name,password" 
[23;80H [24;1H 
[23;80H [24;1H 
[23;80H [24;1H 
[23;80H [24;1HETH-T1>delete user=name,password 
[23;80H [24;1H 
[23;80H [24;1HCant accept reserved characters in your command

Why those left characters are seeing in this file and how can view it neatly.please any one suggest me wht to do.

thank you

Hi vanid,

I understand you want to remove the set of characters [23;80H [24;1H at the beginning of some lines.

If so, try with:

# Removing only set of characters, without affect resulting blank lines 
sed 's/^\[23\;80H \[24\;1H//' inputfile

Or

# Removing set of characters, setting up double spacing in the output
sed -e 's/^\[23\;80H \[24\;1H//;/^$/d;G' inputfile

Hope it helps.

Regards.

I tried it but when writing for expect we need to provide "exec" cmd before this sed command right? if do so its not working here what iam doing:

exec sed {-e s/^\[23\;80H \[24\;1H//} /home/files/logfile.txt

Try as is given by cgkmal in post# 2, except replace the inputfile with your orginal file name.

Thanks to both of you. actually
here what i tried is :

sed -e 's/^\[23\;80H \[24\;1H//;/^$/d;G' /home/file.log

reponse:

invalid command name "sed"
    while executing
"sed -e 's/^\[23\;80H \[24\;1H//"
    (file "READ.exp" line 3)

@scottn, think you're fighting a losing battle there...:smiley:
@vanid, if you don't have sed, you probably don't have awk, but:

awk -F"1H" '!/\[23/{print $0};/\[23/{print $2}' /home/file.log

Thank you so much for the answer. Actually all i have tried but i dont fine any solution iam not able to remove those characters. I am using expect language and if any other options please let me know and it is really appreciable.