文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>(ZT)Eliminate ^M character using vi(Linux)

(ZT)Eliminate ^M character using vi(Linux)

时间:2009-03-23  来源:sjhf

Eliminate ^M character using vi(Linux)

Sometimes certain characters(for eg.,^M characters)are placed in a file during a DOS to UNIX conversion.To modify these files with a lot of ^M symbol at the end of every line,using the vi editor,use the following command:
:%s/^M//g
(To get the ^M hold the control key, press V then M (Both while holding the control key) and the ^M will appear.)
This command will find all occurances and replace them with nothing. Here,the :%s is a basic search and replace command in vi. It tells vi to replace the regular expression between the first and second slashes (^M) with the text between the second and third slashes (nothing in this case). The g at the end directs vi to search and replace globally (all occurrences).
相关阅读 更多 +
排行榜 更多 +
拉力竞速2

拉力竞速2

体育竞技 下载
文字乱舞水浒

文字乱舞水浒

角色扮演 下载
蓝图公考

蓝图公考

学习教育 下载