removing non traditional text

  • Thread starter Thread starter scorpion53061
  • Start date Start date
S

scorpion53061

This is really weird.

I have provided to a client a means for which they can store text in a
database and insert into a word document.

Originally they entered the text into a textbox. However when they copied
and pasted text in there apparently formatting symbols came over as well but
they were not visible. So when they searched for this text in the document
after inserting it the "find" function didnt work.

So I came up with the idea of putting it in a rich textbox. This for the
most preserved the formatting in a visible form. They entered it into the
database. Then they would open it in a regular textbox and remove all I can
call appear to be style markings of some kind (a square in shape).

I am wondering if there is a way to automate the removal of this unorthodox
text.

Thank you all for your help!!
 
Hi Scorp,

Is it always that symbol and does it always appear as the first character?
If either is true, you could look for it on the update to the row in sql and
weed it out, looking for that particular ascii equivalent (sounds like ascii
254 ?).

HTH,

Bernie Yaeger
 
Is it always that symbol and does it always appear as the first character?

Hi Berine

It is this synbol I have attached in a text file. For some reason I cannot
paste it here.

It seems to occur whenever a format change occurs in the text or a break in
the text occurs.

When I try to do a Trim statement in visual studio when I click paste it is
invisible and breaks to the next line.

Is anything able to handle this character?
 
Hi Scorp,

It's weird all right. I remember - a long time ago - converting data from a
Borland Paradox system (I told you it was long ago!) to a foxpro system and
I ran into the same character. It's something like an end of line
character, because you can't get behind it, except with one of itself, and I
was able to rip it out, but I don't recall how I did it. I may have parsed
the line and disallowed anything that wasn't alphanumeric or chr(10) and
chr(13) and dashes, etc, but I honestly do not recall.

Sorry I couldn't be of more help.

Bernie
 
It's something like an end of line
character, because you can't get behind it, except with one of itself, and I
was able to rip it out, but I don't recall how I did it.

Bernie,
Thanks for trying. I am hoping someone else has ideas.
 
Hi Scorp,

I looked at the page you refer to. It's odd but when I try to create
characters with the codes represented there, I get different characters.

In any case, here's an example of parsing a string to remove certain
characters. This example removes Z (chr(90)) from anywhere in the string in
a textbox and places the result into another textbox. I used the first
string's leave event for this, but any event will do.
glf_parsedstring = rawstring.Text

Dim i As Integer

For i = 1 To glf_parsedstring.length

If InStr(Mid(glf_parsedstring, 1, i), Chr(90)) Then

glf_parsedstring = Mid(glf_parsedstring, 1, i - 1) & Mid(glf_parsedstring, i
+ 1)

End If

i += 1

Next

parsedstring.Text = glf_parsedstring

HTH,

Bernie
 
when they copied
and pasted text in there apparently formatting symbols came over as well but
they were not visible. So when they searched for this text in the document
after inserting it the "find" function didnt work.

I have solved this issue. There is no need to respond to this thread.
 
Just curious - how'd you solve it?

You are not going to believe this........

TextBox4.Text = Replace(RichTextBox1.Text, Chr(10), "")

I cannot believe I struggled so hard with this.
 
Still that strange CSV file without a "CR" Scorpion, I never heard if you
did succeed with that sample I have made.

I made it in C# also and thouhgt sending it when you was asking that
question in the C# newsgroup, but did not.

:-))

Cor
 
Still that strange CSV file without a "CR" Scorpion, I never heard if you
did succeed with that sample I have made.

Could you remind me of the sample of which you speak?

The dataset to array to MS Word table code is still not working. I am
getting HResults errors all over the place.

I am SO frustrated by this.

Have you ever done this before?
 
Hi Scorpion,

I see this now, I thought Cindy, me and others where talking about Excel all
the time, paste here in and example of the resultfile you want, than I can
look to it, but no interop with Word, that I did not do a long time, just a
kind of txt format.

Or if you want I can make it in HTML as a table, that is no problem for me
at all and that you can read in Word as a table.

Cor
 
Hi Cor,

Right it was a Word table.

We are trying to use the Word automation object model to write an array
(created from a dataset) to a word table.

I can write it cell by cell but it is painfully slow.

I can also write it via a html within the vb.net app but I have found it
difficult to make a professional looking report this way.
 
Back
Top