removing non traditional text

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • scorpion53061

    removing non traditional text

    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!!


  • Bernie Yaeger

    #2
    Re: removing non traditional text

    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

    "scorpion53 061" <Its the end of the world as we know it@here.com> wrote in
    message news:u%23KsXce5 DHA.2460@TK2MSF TNGP09.phx.gbl. ..[color=blue]
    > 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[/color]
    but[color=blue]
    > 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[/color]
    can[color=blue]
    > 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[/color]
    unorthodox[color=blue]
    > text.
    >
    > Thank you all for your help!!
    >
    >[/color]


    Comment

    • scorpion53061

      #3
      Re: removing non traditional text

      > 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?






      Comment

      • Bernie Yaeger

        #4
        Re: removing non traditional text

        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

        "scorpion53 061" <Its the end of the world as we know it@here.com> wrote in
        message news:%23yC05Mh5 DHA.2416@TK2MSF TNGP10.phx.gbl. ..[color=blue][color=green]
        > > Is it always that symbol and does it always appear as the first[/color][/color]
        character?[color=blue]
        >
        > 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[/color]
        in[color=blue]
        > the text occurs.
        >
        > When I try to do a Trim statement in visual studio when I click paste it[/color]
        is[color=blue]
        > invisible and breaks to the next line.
        >
        > Is anything able to handle this character?
        >
        >
        >
        >
        >[/color]


        Comment

        • scorpion53061

          #5
          Re: removing non traditional text

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

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


          Comment

          • scorpion53061

            #6
            Re: removing non traditional text

            see this link


            it seems to post ASCII codes for characters that look like mine.

            How would I code tell it to remove all ASCII codes that I choose from this
            page


            Comment

            • Bernie Yaeger

              #7
              Re: removing non traditional text

              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_parsedstrin g = rawstring.Text

              Dim i As Integer

              For i = 1 To glf_parsedstrin g.length

              If InStr(Mid(glf_p arsedstring, 1, i), Chr(90)) Then

              glf_parsedstrin g = Mid(glf_parseds tring, 1, i - 1) & Mid(glf_parseds tring, i
              + 1)

              End If

              i += 1

              Next

              parsedstring.Te xt = glf_parsedstrin g

              HTH,

              Bernie

              "scorpion53 061" <Its the end of the world as we know it@here.com> wrote in
              message news:OsHztji5DH A.2736@TK2MSFTN GP09.phx.gbl...[color=blue]
              > see this link
              > http://personalwebs.oakland.edu/~gro...cii.codes.html
              >
              > it seems to post ASCII codes for characters that look like mine.
              >
              > How would I code tell it to remove all ASCII codes that I choose from this
              > page
              >
              >[/color]


              Comment

              • scorpion53061

                #8
                Re: removing non traditional text

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

                I have solved this issue. There is no need to respond to this thread.


                Comment

                • Bernie Yaeger

                  #9
                  Re: removing non traditional text

                  Hi Scorp,

                  Just curious - how'd you solve it?

                  Bernie

                  "scorpion53 061" <Its the end of the world as we know it@here.com> wrote in
                  message news:%23cVR2Iu5 DHA.488@TK2MSFT NGP12.phx.gbl.. .[color=blue]
                  > when they copied[color=green]
                  > > and pasted text in there apparently formatting symbols came over as well[/color]
                  > but[color=green]
                  > > they were not visible. So when they searched for this text in the[/color][/color]
                  document[color=blue][color=green]
                  > > after inserting it the "find" function didnt work.[/color]
                  >
                  > I have solved this issue. There is no need to respond to this thread.
                  >
                  >[/color]


                  Comment

                  • scorpion53061

                    #10
                    Re: removing non traditional text

                    > Just curious - how'd you solve it?

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

                    TextBox4.Text = Replace(RichTex tBox1.Text, Chr(10), "")

                    I cannot believe I struggled so hard with this.


                    Comment

                    • Cor

                      #11
                      Re: removing non traditional text

                      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[color=blue]
                      >
                      > TextBox4.Text = Replace(RichTex tBox1.Text, Chr(10), "")
                      >[/color]


                      Comment

                      • scorpion53061

                        #12
                        Re: removing non traditional text

                        > Still that strange CSV file without a "CR" Scorpion, I never heard if you[color=blue]
                        > did succeed with that sample I have made.[/color]

                        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?


                        Comment

                        • Cor

                          #13
                          Re: removing non traditional text

                          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[color=blue]
                          >
                          > 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?
                          >[/color]


                          Comment

                          • scorpion53061

                            #14
                            Re: removing non traditional text

                            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.
                            "Cor" <non@non.com> wrote in message
                            news:e3fAw905DH A.632@TK2MSFTNG P12.phx.gbl...[color=blue]
                            > Hi Scorpion,
                            >
                            > I see this now, I thought Cindy, me and others where talking about Excel[/color]
                            all[color=blue]
                            > the time, paste here in and example of the resultfile you want, than I[/color]
                            can[color=blue]
                            > look to it, but no interop with Word, that I did not do a long time, just[/color]
                            a[color=blue]
                            > 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[color=green]
                            > >
                            > > 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?
                            > >[/color]
                            >
                            >[/color]


                            Comment

                            Working...