Solved

Need to remove curses markup

Posted on 2011-03-03
2
367 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
Comment Utility

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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now