delete ^M at the end of line
来源:互联网 发布:身材知乎 编辑:程序博客网 时间:2024/05/16 12:46
1. how to denote newline on different OS?
windows: 0D0A (\r\n)
unixlinux: 0A (\n)
MAC: 0D (\r)
2. there are some handy methods to delete ^M:
- open file with vim
:set fileformat=unix :g/^M/s/^M// or :%s/^M//g
sed -i 's/^M//' filename
tr -d '\r' ' '
dos2unix filename
3.参考文档
原文地址忘记了~
0 0
- delete ^M at the end of line
- The End-of-Line Story
- Linux - How to remove the new line at the end of file when using vim
- 服务器返回出现:error on line 19 at column 1: Extra content at the end of the document
- This page contains the following errors: error on line 1 at column 1: Extra content at the end of t
- Why do my text files suddenly have an additional at the end of each line?
- Match at the start/End of a line (匹配行首/行尾)
- firefox报错 关于 JSON.parse: unexpected end of data at line 1 column 1 of the JSON data
- Such Summarize at the end of University .
- Remove ^M characters at end of lines in vi
- by the end of, at the end of , in the end , to the end 的区别与用法
- 在Internal Table 中使用AT FIRST , AT NEW, AT THE END OF , AT LAST, SUM
- Increase the ordinal number at the beginning of each line
- 关于at end of
- at end of不起作用
- warning no newline at the end of file
- warning: no newline at the end of file
- warning no newline at the end of file
- 密码验证合格程序
- LINUX c_并发同步
- 在写网页的时候碰到的一些问题
- 关于Chrome插件content_scripts[0].matches[0]':Invalid scheme
- 51nod-n的阶乘(构造万进制)
- delete ^M at the end of line
- 笔记三 第2章总结及感悟
- kali 信息采集5 采取防火墙与服务器信息
- 定时器——timer0和timer0
- CF #371 div2 B. Filya and Homework
- ViewDragHelper的初体验
- Linux下安装vncserver
- Struts2学习笔记---动态方法的调用
- Unity 游戏存档之XML实现