J
Justin C
Some of the text files I have to parse with perl have control characters
within them. They are controls to turn on and off things when printing
(stuff like "make this bold", "make this bigger", "draw a box around
this", that kind of thing). If I view the text file with /usr/bin/less I
see them as: ESC(s12H ESC&16D ESC(s16H ESC&18D
Viewed in vim they look like: ^[(s12H ^[&16D ^[(16H ^[&18D
Those are the four that jump out at me while scrolling this document,
there are probably more.
I've tried perldoc -q control and perldoc -q escape but neither of those
mentions control characters or escape sequences. Can someone point me at
the documentation I need to help me catch these and strip them out? Will
a regex work? What does perl see these as?
Thank you for your help.
Justin.
within them. They are controls to turn on and off things when printing
(stuff like "make this bold", "make this bigger", "draw a box around
this", that kind of thing). If I view the text file with /usr/bin/less I
see them as: ESC(s12H ESC&16D ESC(s16H ESC&18D
Viewed in vim they look like: ^[(s12H ^[&16D ^[(16H ^[&18D
Those are the four that jump out at me while scrolling this document,
there are probably more.
I've tried perldoc -q control and perldoc -q escape but neither of those
mentions control characters or escape sequences. Can someone point me at
the documentation I need to help me catch these and strip them out? Will
a regex work? What does perl see these as?
Thank you for your help.
Justin.