2008-01-17-how-to-remove-m-character-with-vi.md 480 Bytes
Newer Older
Danesh Manoharan's avatar
Danesh Manoharan committed
1
2
---
title: How to remove ^M character with VI
3
author: Danesh Manoharan
Danesh Manoharan's avatar
Danesh Manoharan committed
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
date: 2008-01-17T09:09:05+00:00
pvc_views:
  - 86698
dsq_thread_id:
  - 889802409

---
This is how you remove those annoying ^M characters that show up in files previously edited on a Windows/DOS platform.

In VI,

    :%s/[ctrlkey+v and ctrl-key+M]//g

actual command,

    :%s/^V^M//g

21
Here's a walk through video I made. My first actually 🙂
Danesh Manoharan's avatar
Danesh Manoharan committed
22
23

[youtube]http://www.youtube.com/watch?v=Fy_w3VDkxKU[/youtube]