The Ctrl M Problem [message #151760] |
Mon, 19 December 2005 01:58 |
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 |
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 #151864 is a reply to message #151760] |
Mon, 19 December 2005 08:53 |
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.
|
|
|