what is ^K?

B

Bing Du

Greetings,

Maybe this is not direcly Perl related...

I'm using Perl (v5.8.0) on Linux (RedHat 9) to process a text file
transferred from Windows to Unix. When I used 'vi' to open the text
file, I saw a lot ^K. In perl, how can I get rid of it? I know I can
use '$line =~ s/\r//g' to remove ^M. What about ^K?

Thanks in advance for any help,

Bing
 
B

Brian McCauley

Glenn Jackman said:
s/\013//g

That removes character with octal encoding 013. This of course is
control-K. But there is a way in Perl to say control-K more directly.

s/\cK//g;

Also I'd probably favour tr///d

tr/\cK//d;

--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top