Trying to remove Hex Characters

vb code , hex code , delete char Woking-Byfleet, United Kingdom
  • 11 years ago

    Hi,

    I am trying to read data from a file, and put certain data into another file. Occasionally I get Hex-Decimal characters which cause the program to crash. The data could be declared as string or long and the problem is never in the same position.

    So I need to be able to check a series of Hex Dec Characters and either only accept standard characters A-Z, 1-9, +" etc, OR allow me to add characters I don't want to be accepted (prefer not if can),

    Immediate thoughts are something like:

    Dim HexKill As Long Dim strline() As String

    For HexKill = 1 to 50 sLine = Replace(sLine, Chr(HexKill), "") Next

    It could be vLookup or Substitute although I don't know if there would any benifit.

    Cheers in advance for any suggestions, this banging my head on the desk is starting to hurt....

  • 11 years ago

    Hi,

    I am trying to read data from a file, and put certain data into another file. Occasionally I get Hex-Decimal characters which cause the program to crash. The data could be declared as string or long and the problem is never in the same position.

    So I need to be able to check a series of Hex Dec Characters and either only accept standard characters A-Z, 1-9, +" etc, OR allow me to add characters I don't want to be accepted (prefer not if can),

    Immediate thoughts are something like:

    Dim HexKill As Long Dim strline() As String

    For HexKill = 1 to 50 sLine = Replace(sLine, Chr(HexKill), "") Next

    It could be vLookup or Substitute although I don't know if there would any benifit.

    Cheers in advance for any suggestions, this banging my head on the desk is starting to hurt....

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“My definition of an expert in any field is a person who knows enough about what's really going on to be scared.” - P. J. Plauger