Trying to remove Hex Characters

vb code , hex code , delete char Woking-Byfleet, United Kingdom
  • 9 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....

  • 9 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.

“A computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are, in short, a perfect match” - Bill Bryson