473,569 Members | 3,054 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Parsing nonprintable characters

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

Nov 20 '05 #1
6 1711
* "=?Utf-8?B?a2Jhcno=?=" <an*******@disc ussions.microso ft.com> scripsit:
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:

<news://msnews.microsof t.com/microsoft.publi c.dotnet.framew ork.adonet>

Web interface:

<http://msdn.microsoft. com/newsgroups/default.asp?url =/newsgroups/loadframes.asp? icp=msdn&slcid= us&newsgroup=mi crosoft.public. dotnet.framewor k.adonet>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
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.
Nov 20 '05 #3
Cor
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.
Nov 20 '05 #4
* "=?Utf-8?B?a2Jhcno=?=" <an*******@disc ussions.microso ft.com> scripsit:
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?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #5
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

Nov 20 '05 #6
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
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
10559
by: Don Hiatt | last post by:
Greetings, Is there an easy way to remove multiple non-printable (e.g. "not strings.printable") from a string? Perhaps something like foo.replace(list_of_nonprintables, '') if it only existed? :-) Cheers, don
8
2249
by: Anita | last post by:
Hi All I have a table with one column : CREATE TABLE test2 ( a char(15) primary KEY CLUSTERED ) The column a is filled with encrypted data (contains control and extended characters).
2
4337
by: David Pratt | last post by:
I am working with a text format that advises to strip any ascii control characters (0 - 30) as part of parsing data and also the ascii pipe character (124) from the data. I think many of these characters are from a different time. Since I have never seen most of these characters in text I am not sure how these first 30 control characters are...
2
2084
by: JaythePCguy | last post by:
Hi, I am trying to write a text parser to group all nonprintable and control characters, spaces and space delimited words in different groups using Regex class. Using a parsing of (?<Commands>)|(?<Spaces>)|(?<Text>+) on my sample text of \tOne\ncar red \fcar\a blue car\r\n \r\n does not work as indetended. Specially, the spaces are grouped...
1
2420
by: yonido | last post by:
hello, my goal is to get patterns out of email files - say "message forwarding" patterns (message forwarded from: xx to: yy subject: zz) now lets say there are tons of these patterns (by gmail, outlook, etc) - and i want to create some rules of how to get them out of the mail's html body. so at first i tried using regular expressions:...
3
2693
by: aspineux | last post by:
My goal is to write a parser for these imaginary string from the SMTP protocol, regarding RFC 821 and 1869. I'm a little flexible with the BNF from these RFC :-) Any comment ? tests= def RN(name, regex): """protect using () and give an optional name to a regex""" if name:
13
4475
by: Chris Carlen | last post by:
Hi: Having completed enough serial driver code for a TMS320F2812 microcontroller to talk to a terminal, I am now trying different approaches to command interpretation. I have a very simple command set consisting of several single letter commands which take no arguments. A few additional single letter commands take arguments:
3
2999
by: =?ISO-8859-1?Q?Fabian_L=F3pez?= | last post by:
Hi, I am parsing an XML file that includes chineses characters, like ^ uuࢲDZw.Lﳲǐ or إ... The problem is that I get an error like: UnicodeEncodeerror:'charmap' codec can't encode characters in position.... The thing is that I would like to ignore it and parse all the characters less these ones. So, could anyone...
6
3506
by: James Arnold | last post by:
Hello, I am new to C and I am trying to write a few small applications to get some hands-on practise! I am trying to write a random string generator, based on a masked input. For example, given the string: "AAANN" it would return a string containing 3 alphanumeric characters followed by 3 digits. This part I have managed:) I would now...
0
7703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main...
0
7930
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8138
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7681
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5228
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3662
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
950
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.