Remove carriage return from text file

 ̄綄美尐妖づ 提交于 2019-12-08 11:21:09

问题


I have a text file that is | delimited and is over 59,000 line long. How can I remove the carriage returns so each line is one record?

Here is what the current file looks like:-

Here is what I need it to look like:-

Any help would be awesome


回答1:


Do a regular expression find/replace like this:

  • Open Replace Dialog
  • Find What: [^|\n\r]\R
  • Replace With: \1
  • check regular expression
  • click Replace or Replace All

It matches OS-linebreaks (\R) that are not (^) preceded by a | or \r or \n. Should work with any EOL convention.



来源:https://stackoverflow.com/questions/38758450/remove-carriage-return-from-text-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!