Removing ”^M” from SQL*Loader datafile

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:




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.

5 thoughts on “Removing ”^M” from SQL*Loader datafile

Want to give some comment to author ( Shivmohan Purohit )

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s