How to remove unknown line break (special character) in text file?

懵懂的女人 提交于 2019-12-25 21:29:17

问题


I have a text file which shows a Line Break in UltraEdit if we replace a special character in text file manually it works fine. Unknown Line Break. I have to change it manually and then process the files.

Please let me know some way how to remove all occurrences of this character with VB.Net code.

If I replace ♀ in UltraEdit, it replaces line break with my desired string. But in my VB string I cannot use this character or line break.


回答1:


The character you have in your file is the form-feed character usually used as control character for a page break.

In UltraEdit in Page Setup configuration dialog (a printing related dialog) there is the option Page break code which has by default the decimal value 12 (hexadecimal 0C) which is the form-feed character.

A page break can be displayed in UltraEdit with a horizontal line across the document window on enabling Show Page Breaks as Lines in menu/ribbon View.

The form-feed character can be removed in UltraEdit with searching for ^b on using a normal, non regular expression or an UltraEdit regular expression replace, or with searching for \f on using a Unix or Perl regular expression replace.

In VB.Net code ChrW(12) can be used to reference the form-feed control character as suggested already by Hans Passant.



来源:https://stackoverflow.com/questions/38662676/how-to-remove-unknown-line-break-special-character-in-text-file

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