If you see control M characters(^M) in a file in UNIX, don't worry there is a very simple way to convert the file in UNIX format.
The command is
dos2unix filename [newfilename]
e.g. remove control characters from file abc.txt
dos2unix abc.txt abc.txt #this will replace abc.txt and remove control characters
dos2unix abc.txt xyz.txt #a new file xyz.txt will be created after removing control characters
So isn't that simple lovely command took off all the worries.
4 Comments:
Hi Suresh,
Took good effort to post these articles. Some are new to me. Please don't leave posting articles. Good stuff.
Bye
Hemanth
Hi Suresh,
If I am using an concurrent job to ftp the file and then SQL Load, how do I remove the control M characters in this case.
Thanks, Sanjana.
use dos2unix command in the shell script after file is FTPed.
Suresh
This site has always has something to offer.This is a very tricky problem which many professionals also fail to understand. Thanks for the information.
Post a Comment