-2

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.

Mofi
  • 46,139
  • 17
  • 80
  • 143
  • 1
    If you use a hex editor to examine the file before and after manually editing it, you will be able to determine that. You *probably* want to use `VbCrLf` as the replacement. – Andrew Morton Jul 29 '16 at 17:53
  • It is a form-feed, ChrW(12) in vb.net code. Common when the output was intended for a printer. – Hans Passant Jul 29 '16 at 18:18
  • @HansPassant Thanks for such info can you show some exemplary code to work with ChrW(12)...? I will be greatful. Regards – Azwar Durrani Jul 30 '16 at 07:16

1 Answers1

0

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.

Community
  • 1
  • 1
Mofi
  • 46,139
  • 17
  • 80
  • 143