如何删除文本文件中的未知的换行符(特殊字符)? [英] How to remove unknown line break (special character) in text file?

查看:413
本文介绍了如何删除文本文件中的未知的换行符(特殊字符)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我们手动替换文本文件中的特殊字符,它就能正常工作,我有一个在UltraEdit中显示 Line Break 的文本文件。 未知分行。我必须手动改变它,然后处理这些文件。



请让我知道如何使用VB.Net代码删除所有出现的这个字符。



如果我在UltraEdit中替换♀,它将用我想要的字符串替换换行符。但是在我的VB字符串中,我不能使用这个字符或者换行符

解决方案

您在文件中的字符是 form-feed 通常用作分页控制字符。


$ b UltraEdit <在页面设置配置对话框(与打印相关的对话框)中,有分页代码选项,默认情况下为十进制值12(十六进制0C)您可以在 UltraEdit 中显示一个分页符,在文档窗口中显示一条水平线,以便启用显示分页符在 UltraEdit 菜单/功能区视图中的

>使用普通的非正则表达式或UltraEdit正则表达式替换或搜索 \ f 来搜索 ^ b c $ c>使用Uni x或Perl正则表达式替换。



在VB.Net代码 ChrW(12)中可以用来引用如 Hans Passant 所建议的,表单提要控制字符。


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.

解决方案

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.

这篇关于如何删除文本文件中的未知的换行符(特殊字符)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆