Solved

Need to remove curses markup

Posted on 2011-03-03
2
371 Views
Last Modified: 2012-05-11
I have the need to telnet (programatically) and scrape output off the screen (stdout) from certain commands.  Problem is as I am running this on my windows machine at least (have not tested on Linux) I get a lot of weird curses markup which I would like to filter out.  It looks something like this on the windows command prompt when I run the app.  Intermixed in there I have identified as the stuff I want with 'value i want'.  Is there some way to get rid of this markup and have it display properly?


Thanks,


¿>¿[?3l¿[?4l¿[?5l¿[m¿[?7h¿[?8h¿(B¿)0¿[1;1H
                                          ¿[2;1H
                                                ¿[3;1H
                                                      ¿[4;1H
                                                            ¿[5;1H
                                                                  ¿[6;1H
                                                                        ¿[7;1H
                                                                              ¿[
8;1H
    ¿[9;1H
          ¿[10;1H
                 ¿[11;1H
                        ¿[12;1H
                               ¿[13;1H
                                      ¿[14;1H
                                             ¿[15;1H
                                                    ¿[16;1H
                                                           ¿[17;1H
                                                                  ¿[18;1H
                                                                         ¿[19;1H

¿[20;1H
       ¿[21;1H
              ¿[22;1H
                     ¿[23;1H
                            ¿[24;1H
                                  ¿[1;1Hvalue I want¿[2;value I want
¿[3;1Hvalue I want¿[4;1Hvalue I want¿[6;1Hvalue I want¿[7;1HValue I want¿[

Open in new window

0
Comment
Question by:Mr_Oz
2 Comments
 
LVL 47

Accepted Solution

by:
for_yan earned 500 total points
ID: 35029399

How are you using telnet programmatically?
I'd think that some abailable Java telnet client libraries
(e.g. like http://javassh.org/space/start)
 should take care of this extra symbols and present you with the valuable
data only. Isn't it the case?
0
 
LVL 1

Author Comment

by:Mr_Oz
ID: 35029615
I think that may work better than what I am doing as it includes a terminal.  I will give it a a try thanks.

0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
how to see all occupied ports on windows 10 laptop 15 62
servlet web applications   metadata-complete="true" or false 3 37
throw exception 21 43
jboss wildfly 10.1 10 81
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question