RE: Stripping out hex codes from text file



Hi Pete,

This kind of a thing can eb done in Visual Basic. This text file is a comma
seprated file right?

Here is what you do, open the text file, assign the first line to a
variable, usign a combination of mid$(<string>,<star value>,instr$(<the
arguments>)) you can search if the line has hex value, or the other values,
remove them, then add a new record to the access table, open the access table
suing automation and, break the string into different fields and add it to
the database.

Another approcah is that read word by word, again usign the same
mid$(<string>,<star value>,instr$(<the arguments>)) combination and check if
the value is a hex or any other character that you don't want, if they both
match don't add to the table, if they match you can add them to the table.

I suggest access automation using vb becuase if you open it using a data
control or odbc driver, it might not allow the kind of flexiablity that might
be needed.

Hope you found this information useful.

Anand

--
"Who will guard the guards?"


"DubboPete" wrote:

> Hi all,
>
> I have a text file which needs to be imported into a db. The file
> structure unfortunately contains extra characters in the various fields
> that are generated by the ancient program that exports the text file.
>
> is there a way to strip out hex codes, underscores, or ascii characters
> such as alt-0143 (), and so on, just leaving the raw data?
>
> Any help/guidance/pointers to knowledgebase much appreciated.
>
> DubboPete
>
>
.



Relevant Pages

  • Re: Fw: Hex to Decimal Conversion in COBOL
    ... I don't know why a COBOL source solution is absolute- ... the "abcde" string would be replaced by the entire 255 hex ... in unprintable characters also. ...
    (bit.listserv.ibm-main)
  • Re: How to destroy Leopard/Vista/Dragon, all at one fell swoop
    ... I prefer to use words to get across meaning, as in "hex zero", which is ... winded technical explanation about characters, bytes, numbers, ... Try explaining "hex notation" to an unknowledgeable reader, ...
    (comp.sys.mac.system)
  • Re: converting char-string (binary ieee representation) to double
    ... >> those characters into the 2 hex digits that represent the value. ... The second error is that the double precision exponent offset is 1023, ... if the strings of eight full-range characters you are ... expanded to binary form, give the exact binary form of the numbers you ...
    (comp.soft-sys.matlab)
  • Re: Which Sub-system is deleting my message?
    ... with IBM ad they will give you a trap to run a SLIP trace. ... You can probably eliminate the command test. ... m1 is the hex of the 1st 4 characters of the message id ...
    (bit.listserv.ibm-main)
  • Re: culture/character noodling
    ... minor characters, and maybe even in a cameo role for the lead ... It had me think of the guard I have in the ME, ... At least the history only came with a viewpoint (which has me think ... and not a personality. ...
    (rec.arts.sf.composition)