Alright, I posted on here recently and did a terrible job at it. I want to retry and explain my situation as best as possible. I wrote a script to query my telnet system and record the output in to a text file. It does all of that and outputs the correct data to the text file, but it is giving me all of these unwanted terminal characters and I having a very hard time removing these. I am extremely new to Perl programming and would appreciate the help. Here is my output(everything bolded) are what I want removed:

list tvbs dnv 3334 06:00 [1;1H [24;0H [K 7 [1;1H [0;7m list tvbs dnv 3334 06:00 [0m 8 [23;0H [0;7m [0m [23;0H [2;1H [K [B [K [B [K [B [K [B [K [B [K [B [K [B [K [B [K [B [K [B [K [B [K [B [K [B [K [B [K [B [K [B [K [B [K [B [K [B [K [B [K [B 7 [1;65H [0;7m Page 1 [0m 8 [3;1H [3;23H TVBS DIRECTORY REPORT [5;1HName: [5;47HDate: 11:43 am THU JUN, 2011 [6;9HDVN: 3555 [7;4HDVN Name: System [7;49HAcceptable Level: 20 [9;13H AVG AVG AVG CALLS % IN [10;13HCALLS ACD SPEED ABAND ABAND TALK/ CONN FLOW BUSY/ SERV [11;1HTIME [11;13HOFFERED CALLS ANSW CALLS TIME HOLD CALLS OUT DISC LEVL [13;1H 6:00- 7:00 [13;14H 12 [13;21H 0 [13;27H 0:00 [13;33H 0 [13;39H 0:00 [13;45H 0:00 [13;51H 0 [13;58H 12 [13;64H 0 [13;71H 0 [14;1H 7:00- 8:00 [14;14H 7 [14;21H 0 [14;27H 0:00 [14;33H 0 [14;39H 0:00 [14;45H 0:00 [14;51H 0 [14;58H 7 [14;64H 0 [14;71H 0 [15;1H 8:00- 9:00 [15;14H 15 [15;21H 0 [15;27H 0:00 [15;33H 2 [15;39H 0:08 [15;45H 0:00 [15;51H 0 [15;58H 13 [15;64H 0 [15;71H 0 [16;1H 9:00-10:00 [16;14H 12 [16;21H 0 [16;27H 0:00 [16;33H 0 [16;39H 0:00 [16;45H 0:00 [16;51H 0 [16;58H 12 [16;64H 0 [16;71H 0 [17;1H10:00-11:00 [17;14H 6 [17;21H 0 [17;27H 0:00 [17;33H 0 [17;39H 0:00 [17;45H 0:00 [17;51H 0 [17;58H 6 [17;64H 0 [17;71H 0 [18;1H----------- [18;14H------ [18;21H----- [18;27H----- [18;33H----- [18;39H----- [18;45H----- [18;51H------ [18;58H----- [18;64H----- [18;71H--- [19;1HSUMMARY [19;14H 52 [19;21H 0 [19;27H 0:00 [19;33H 2 [19;39H 0:08 [19;45H 0:00 [19;51H 0 [19;58H 50 [19;64H 0 [19;71H 0 7 [23;0H[0;7m

It should look like this:

list tvbs dnv 3334 TVBS DIRECTORY REPORT Name: Date: 11:53 am THU, 2011 DVN: 3555 DVN Name: Suppotrt Acceptable Level: 20 AVG AVG AVG CALLS % IN CALLS ACD SPEED ABAND ABAND TALK/ CONN FLOW BUSY/ SERV TIME OFFERED CALLS ANSW CALLS TIME HOLD CALLS OUT DISC LEVL 5:00- 6:00 1 0 0:00 0 0:00 0:00 0 1 0 0 6:00- 7:00 12 0 0:00 0 0:00 0:00 0 12 0 0 7:00- 8:00 7 0 0:00 0 0:00 0:00 0 7 0 0 8:00- 9:00 15 0 0:00 2 0:08 0:00 0 13 0 0 9:00-10:00 12 0 0:00 0 0:00 0:00 0 12 0 0 10:00-11:00 6 0 0:00 0 0:00 0:00 0 6 0 0 ----------- ------ ----- ----- ----- ----- ----- ------ ----- ----- --- SUMMARY 88 0 0:00 4

Thank you guys very much and sorry for the annoying formatting.

In reply to Parsing/Removing Characters from Text File by mizmaster22

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.