Home » Infrastructure » Unix » regarding ctrl+m article in knowledge base
regarding ctrl+m article in knowledge base [message #142919] Tue, 18 October 2005 07:30 Go to next message
vamsi kasina
Messages: 2096
Registered: October 2003
Location: Riyadh, Saudi Arabia
Senior Member
Hi all,
I think I have seen an article in knowledge base of orafaq regarding removing ctrl+m character in UNIX machine.

Can anybody give me the navigation for that?

Thanks in adv.,
Vamsi.
Re: regarding ctrl+m article in knowledge base [message #142974 is a reply to message #142919] Tue, 18 October 2005 09:37 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10629
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
To remove the ^M characters at the end of all lines in vi, use:

:%s/^V^M//g

The ^v is a CONTROL-V character and ^m is a CONTROL-M. When you type this, it will look like this:

:%s/^M//g

[Updated on: Tue, 18 October 2005 09:37]

Report message to a moderator

Re: regarding ctrl+m article in knowledge base [message #143066 is a reply to message #142974] Wed, 19 October 2005 00:13 Go to previous messageGo to next message
vamsi kasina
Messages: 2096
Registered: October 2003
Location: Riyadh, Saudi Arabia
Senior Member
Thanks for your reply.

By,
Vamsi.
Re: regarding ctrl+m article in knowledge base [message #143222 is a reply to message #143066] Wed, 19 October 2005 09:12 Go to previous messageGo to next message
Jai Vrat Singh
Messages: 205
Registered: September 2002
Location: Singapore
Senior Member
More precisely (for end ^M char only)
Quote:

%s/^M$//g


This problem comes when you ftp a ascii txt file from windows to unix machine in binary mode. Use ascii mode to ftp so that you do not get ^M characters at all. ( this was not you wanted to know but just in case...)
Re: regarding ctrl+m article in knowledge base [message #474702 is a reply to message #143222] Wed, 08 September 2010 06:11 Go to previous message
kenoti
Messages: 1
Registered: September 2010
Location: Nairobi
Junior Member
Thanks alot this sorted me out.
cat faulty_file.dat|sed 's/^M$//g' > cleanfile.data
sqlldr control='ctlfile' data=cleanfile.data
Previous Topic: otn downloads
Next Topic: listing files in solaris with inode number
Goto Forum:
  


Current Time: Sun Nov 23 06:37:33 CST 2014

Total time taken to generate the page: 0.07260 seconds