Home » Infrastructure » Unix » The Ctrl M Problem
The Ctrl M Problem [message #151760] Mon, 19 December 2005 01:58 Go to next message
mickey
Messages: 2
Registered: December 2005
Location: Singapore
Junior Member
Hi guyz,

I have a unix log file which contains the record that are
discarded during the loading to an Oracle db using SQLLOADER.
The ".bad" file contains CTRL M(^M) Database Guard is enabled
character with a line feed immediately after that.

I have gone through a lot of resources on the net to solve
the issue but I dont have any success.

But finally I came to a solution that if I open the
.bad file in wordpad and save it , it removes the
character and line feed automattically.

Now the customer dont need this manual solution.

So I tried to find wordpad for Unix and endup with vim and other
editors but they are different from wordpad.They dint complete
the job.

So suggest me something. I want to remove ctl M character
and line feed at the same time.

One more thing . When I remove the ctrl M by giving
%s/^M//g . it does remove the character but not line feed.

If I press shift J manually at line feed it removes the line
feed and record comes into one line.

Please suggest me something to solve the issue.

Thanks,

Mickey



Re: The Ctrl M Problem [message #151826 is a reply to message #151760] Mon, 19 December 2005 06:35 Go to previous messageGo to next message
orausern
Messages: 826
Registered: December 2005
Senior Member
On the unix server, give the command:

$unix2dos <unix log file name > <new file name without ctrl M>

the new file will not have those ctrl M characters..

Re: The Ctrl M Problem [message #151849 is a reply to message #151760] Mon, 19 December 2005 07:39 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
http://www.orafaq.com/forum/m/142974/42800/?srch=vi+remove+control+character#msg_142974
Re: The Ctrl M Problem [message #151864 is a reply to message #151760] Mon, 19 December 2005 08:53 Go to previous message
mickey
Messages: 2
Registered: December 2005
Location: Singapore
Junior Member
Thanks for the reply.

But I have already tried %s/^M//g . It removes the ctrl M character but not the line feed.

Do you know how to get SHIFT J working in unix shell scripting.

I want to press shift J using unix shell scripting like keypress.

Previous Topic: Swap space
Next Topic: Raw attachment(EXCEL (huge size to get split up)) in oracle pl/sqp UNIX
Goto Forum:
  


Current Time: Thu Mar 28 16:03:04 CDT 2024