Extra characters are coming through telnet

Hi,

I have opened a socket to the particular port and IP address. I am receiving the output from that terminal.In that terminal I could see some texts are in bold. But when I receive in my client program, I am seeing some extra characters with that string instead of bold.Is there any solution to avoid those characters or get the same format what ever in terminal . Please help me to resolve .

thanx

Prakash

[434 byte] By [raja30a] at [2007-10-3 8:39:11]
# 1
You are getting the contents of the Telnet protocol. This consists of more that what the terminal displays. You need to parse it and ignore what you don't want, or use an existing Telnet implementation.
ejpa at 2007-7-15 3:47:15 > top of Java-index,Archived Forums,Socket Programming...
# 2

Hi,

Thank you for your response. The data contents are very huge, to parse those data it will take more time because so many tokens are in bold in the terminal.Is there any other way to avoid this- (content of telnet protocol)? (existing telnet implementation) please suggest.

thank you

Prakash

raja30a at 2007-7-15 3:47:15 > top of Java-index,Archived Forums,Socket Programming...
# 3

You mean is there any way to remove the characters you don't want without finding them first? I don't think so, but I could be wrong, miracles could happen. An angel could come down from heaven and solve your problem in zero time and space. You never know.

You could try setting term=dumb so there is no bold at all, but even still requires you to know something about the Telnet protocol. And you'll still get some Telnet commands in there from the server which you also have to remove.

If you don't like the protocol don't use it.

ejpa at 2007-7-15 3:47:15 > top of Java-index,Archived Forums,Socket Programming...
# 4
> An angel could come down from heaven and> solve your problem in zero time and space. But you are that angel, ejp. The socket/network guardian angel. Guarding against all evil protocol attacks against all divine ports.;-)
masijade.a at 2007-7-15 3:47:15 > top of Java-index,Archived Forums,Socket Programming...
# 5
Sorry I meant to say, Now I am receiving more than 60 k lines with in 2 or 3 minutes using telnet by 8 k lines per read. If I start to parse token by token It is increasing the time as well as after some time It is blocking the telnet session.
raja30a at 2007-7-15 3:47:15 > top of Java-index,Archived Forums,Socket Programming...
# 6
It is just possible that there are better ways to parse than what you are presently doing.Seriously, just find a Telnet client package and use that. Surely there's one in Apache? anyway google is your friend.
ejpa at 2007-7-15 3:47:15 > top of Java-index,Archived Forums,Socket Programming...