Parsing nonprintable characters

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have a VB.Net program that extracts data from Word document tables and saves it off to Sql Server. I notice that when it gets to the database, there are two nonprintable characters on the end of each field. I thought of using substring-before to parse these out, but I'm not sure how to refer to them as they are just represented as squares in the database. I'd also like to convert number strings to numerics but need to get rid of these first. Any idea of how I can identify what they are in order to use substring-before? Or is there some other function that would work better?

Thanks
 
* "=?Utf-8?B?a2Jhcno=?= said:
I have a VB.Net program that extracts data from Word document tables
and saves it off to Sql Server. I notice that when it gets to the
database, there are two nonprintable characters on the end of each
field. I thought of using substring-before to parse these out, but I'm
not sure how to refer to them as they are just represented as squares in
the database. I'd also like to convert number strings to numerics but
need to get rid of these first. Any idea of how I can identify what
they are in order to use substring-before? Or is there some other
function that would work better?

This is a VB.NET language group. You will more likely get an answer if
you post your question to the .NET database group:

ADO.NET group:

<
Web interface:

<http://msdn.microsoft.com/newsgroup...roup=microsoft.public.dotnet.framework.adonet>
 
I'm just trying to get the nonprintable characters out of my string of text. That has nothing to do with the database other than it will eventually wind up there.
 
Hi kbarz,

I think you can better asked this like Herfried sugested in the adonet group
or maybe Bill will answered it here.

It has to do with the datatype the field of your database, but that is SQL
and I always take the wrong one myself.

Cor

I'm just trying to get the nonprintable characters out of my string of
text. That has nothing to do with the database other than it will
eventually wind up there.
 
* "=?Utf-8?B?a2Jhcno=?= said:
I'm just trying to get the nonprintable characters out of my string of
text. That has nothing to do with the database other than it will
eventually wind up there.

I am not sure where you want to do that. What do you define as
non-printable character? A character which isn't included in a certain
character set? Which encoding do you use?
 
Have you tried/looked at Regular Expressions
If your looking to strip out the text/numerics you could create a RegEx for that
I guess it would depend on the format of the word documents and whether you could apply pattern matching to them
 
Just a WAG, maybe they're carriage return/line feed charcters.

If it's always the two last characters, that would be easy to strip
off. If you want to know what the characters are, you could do a
Asc() on the character to find the decimal value, or maybe save the
string to a text file and inspect with a hex editor.

HTH,
Mike
 
Back
Top