Oracle Applications – Business & Technology

Removing ”^M” from SQL*Loader datafile

May 13, 2009 · 3 Comments

You notice that you have extra ‘^M’ characters at the end of your records in your SQL*Loader datafile. You need to remove them so your load will work successfully.

————————–

You can remove the ^M by doing the following:

 

Bring the datafile into the Unix editor vi. In command mode you would type in:

 

:1,$s/^V^M//

 

Make sure you are entering ‘control V’ and ‘control M’. The ‘control V’ says to accept the next character exactly as I type it. Adding the two slashes at the end of the command says to subsitute the ^M with null.

 

The extra ^M characters are most likely due to moving the file from one platform to another. The carriage returns or end-of-line commands are sometimes interpreted differently.

 

You can see this if you move a file from a PC to a UNIX system or if you copy a file from one system through a gateway to a different system.

Categories: Oracle Functional

3 responses so far ↓

Leave a Comment