LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-09-2003, 01:27 AM   #1
chandan
Member
 
Registered: Feb 2003
Location: Bangalore, India
Distribution: Fedora Core 2
Posts: 60

Rep: Reputation: 15
strange character ^M


I typed a file in dos.
when i opened the same file in vi, each line ends with ^M
it looks very bad.
how to remove all these ^M.
is there any vi command to help me.
thanks in advance.
 
Old 07-09-2003, 01:30 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
^M = DOS-Line-feed (CR/LF)

Most distro's will come
with either todos and fromdos
or a dos2unix and unix2dos...

Cheers,
Tink
 
Old 07-09-2003, 02:38 AM   #3
lfur
Member
 
Registered: Jul 2003
Location: Slovenia
Distribution: Slackware & FreeBSD
Posts: 209

Rep: Reputation: 30
You can also remove ^M with:

in vi (or vim):
:1,$ s'^M''g

or with tr:
tr -d '^M' <inputfile >outputfile
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with character vacilus Linux - Software 0 02-17-2005 05:34 AM
strange, strange alsa problem: sound is grainy/pixellated? fenderman11111 Linux - Software 1 11-01-2004 05:16 PM
Sound Issues with XMMS/ mpg123 strange (strange noises) thegreatbob Linux - Software 0 06-25-2004 03:18 PM
Strange character on man pages alaerte Linux - Newbie 4 07-29-2003 02:17 PM
^M character david_wliu Linux - General 6 03-16-2003 11:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration