what are they ^Y, ^S, etc?

B

bing

I have a text file which was generated on Windows but needs to be
parsed on linux by a Perl script. The file contains some strange chars
some of which I know their meanings, like ^M is \r and ^K is Vertical
Tab, but some I don't, like ^Y and ^S. The Perl script should get rid
of these strange chars.

Anybody know what ^Y and ^S are? Better even where can I find the
definitions of these chars?

I'd appreciate any help,

Bing
 
A

attn.steven.kuo

bing said:
I have a text file which was generated on Windows but needs to be
parsed on linux by a Perl script. The file contains some strange chars
some of which I know their meanings, like ^M is \r and ^K is Vertical
Tab, but some I don't, like ^Y and ^S. The Perl script should get rid
of these strange chars.

Anybody know what ^Y and ^S are? Better even where can I find the
definitions of these chars?

I'd appreciate any help,

Bing



$ perl -Mcharnames=:full -le '($a="a") =~ tr/a/\cS/; print
charnames::viacode(ord($a));'
DEVICE CONTROL THREE


$ perl -Mcharnames=:full -le '($a="a") =~ tr/a/\cY/; print
charnames::viacode(ord($a));'
END OF MEDIUM


As far as removing these characters, see:

perldoc -f tr
 
J

John Bokma

bing said:
I have a text file which was generated on Windows but needs to be
parsed on linux by a Perl script. The file contains some strange chars
some of which I know their meanings, like ^M is \r and ^K is Vertical
Tab, but some I don't, like ^Y and ^S. The Perl script should get rid
of these strange chars.

Anybody know what ^Y and ^S are? Better even where can I find the
definitions of these chars?

If ^M = \r = 13 you can get the codes of the other ones.

See http://www.asciitable.com/
 
?

????? ????? (Shantanoo Mahajan)

bing said:
I have a text file which was generated on Windows but needs to be
parsed on linux by a Perl script. The file contains some strange chars
some of which I know their meanings, like ^M is \r and ^K is Vertical
Tab, but some I don't, like ^Y and ^S. The Perl script should get rid
of these strange chars.

Anybody know what ^Y and ^S are? Better even where can I find the
definitions of these chars?

I'd appreciate any help,

Bing

OT way to do it.
Following has been tested on FreeBSD.

col -bx < _file_ > _file_.new

Regards,
Shantanoo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top