Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 385
  • Last Modified:

Need to remove curses markup

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
Mr_Oz
Asked:
Mr_Oz
1 Solution
 
for_yanCommented:

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
 
Mr_OzAuthor Commented:
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now