Thursday, June 20, 2013
12:34 PM

Remove Control M' Characters (^M) with Unix and Linux commands

Using dos2unix  command
dos2unix ORIG_FILENAME TEMP_FILENAME
mv TEMP_FILENAME ORIG_FILENAME
IMP NOTE: use dos2ux command if you are using HPUX
                    use dos2unix  command if you are using LINUX
Using sed command
sed ‘s/^M//g’ ORIG_FILENAME > TEMP_FILENAME
mv TEMP_FILENAME ORIG_FILENAME
IMP NOTE: To get ^M in UNIX (Hold control key and then press v and m character).  
Using vi Editor
ESCAPE   :%s/^M//g ENTER
IMP NOTE: To get ^M in UNIX (Hold control key and then press v and m character).

0 comments:

Post a Comment

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.