Loading ...
Sorry, an error occurred while loading the content.
 

Re: Reply: Re: [NTB] finding/replacing

Expand Messages
  • Don Passenger
    Ok CarOline, Let s hope Jody is busy with the new digs and never sees this post .... I am copying the clips list and ask that any reply s be over there. There
    Message 1 of 9 , Mar 28, 2002
      Ok CarOline,

      Let's hope Jody is busy with the new digs and never sees this post ....
      I am copying the clips list and ask that any reply's be over there. There
      is undoubtly a way to smarten this up so that it only acts on the non-tag
      portion, and yet this is much faster than a search and replace.

      Comment or remove the first line ^!Jump if you want to start at your cursor
      and if you need to stop at any point use control/alt/space bar.

      To get this into a clipbook, copy (highlight control C) and right click in
      the little library clip window pane to the left usually and choose add from
      clipboard, click okay and you should have it.

      ***copy next line and following***
      ^!Jump Text_Start
      ;skip above line if you want to start at cursor

      ;find the next quoted material
      :nextfind
      ^!Find "[\"]+[a-z 0-9]+[\"]" R

      ;offer choice of converting this or not
      ^!Skip Replace These Quotes?
      ^!GoTo nextfind

      ;replace each quote with correct &xquo
      :replace_quotes
      ^!Replace """ >> "&lquo;" H
      ^!Replace """ >> "&rquo;" H
      ;recycle
      ^!GoTo nextfind

      :END
      ***stop copying***

      --
      Don Passenger
      mailto:dpasseng@...
      home: http://www.iserv.net/~dpasseng
      work: http://www.grcourt.org
      ----- Original Message -----
      From: "carOline" <pinky@...>
      To: <notetab@yahoogroups.com>
      Cc: <notetab@yahoogroups.com>
      Sent: Thursday, March 28, 2002 3:41 PM
      Subject: Reply: Re: [NTB] finding/replacing


      > Hi All,
      >
      > Thanks for your suggestions! The reason we want to find quotes outside of
      tags
      > is to turn them from straight quotes to smart quotes (&lquo; and &rquo;).
      I'm a
      > newbie here so forgive me. I guess I should subscribe to the clips list!
      >
      > Caroline
      >
      >
      > On Thu, 28 Mar 2002 14:33:41 -0500 Don Passenger <dpasseng@...>
      wrote:
      >
      > # While perhaps a good start ( ["/]+[a-z 0-9]+["/] ), this doesn't do
      what is
      > # being asked. They want to ignore quotes inside of a tag. This finds
      quotes
      > # inside tags AND will find each of these things:
      > # /word"
      > # /word/
      > # "/
      > # "word/
      > # "word"
      > # etc.
      > #
      > # Next:
      > # [\"]+[a-z 0-9]+[\"]
      > # this is probably what was meant in the first place
      > # it only finds "word" but then it finds them inside the tags still.
      > #
      > # Next I say ... how about this:
      > # >\a*" \a*" \a*<
      > # but this won't work because regex is greedy (check archives for Wayne's
      > # regex missives -- great reading) so it will take the first > in the file
      and
      > # the last < in the file and and if it finds two quotes in the middle ...
      you
      > # get it all highlighted.
      > #
      > # Plus this effort wouldn't find anything before the first tag, even if it
      > # weren't greedy.
      > #
      > # I really think a clip is the answer here:
      > # start at the top of the file
      > # search for first to occur of quote or tag opening <
      > # if find tag first skip ahead to tag close otherwise if find quote first
      find
      > # matching quote (note if there are mismatched quotes you could be back in
      a
      > # tag*)
      > # repeat as necessary
      > #
      > # Again... what is the purpose, do you need to operate on the quotes,
      escape
      > # them, look at what is in between them ...
      > #
      > # You could even get fancier so that you turn a variable on and off as you
      go
      > # in and out of tags so that it would find quote and not try to find the
      > # matching quote after it enters a tag - or skips the tag and finds the
      > # matching quote on the other side.
      > #
      > # But this is a clips list question if we are going there.
      > # It certainly can be done. Wayne will suggest using perl no doubt which
      is
      > # faster and better ...
      > #
      > # --
      > # Don Passenger
      > # mailto:dpasseng@...
      > # home: http://www.iserv.net/~dpasseng
      > # work: http://www.grcourt.org
      > # ----- Original Message -----
      > # From: "David McIntosh" <dgmc@...>
      > # To: <notetab@yahoogroups.com>
      > # Sent: Thursday, March 28, 2002 9:08 AM
      > # Subject: Re: [NTB] finding/replacing
      > #
      > #
      > # > Hi
      > # > in the find replace box the quotes replace with anything
      > # > in find box TRY ["/]+[a-z 0-9]+["/] and check the reg exp.
      > # >
      > # > THANKYOU DAVE
      > # >
      > # > carOline wrote:
      > # > >
      > # > > Hi,
      > # > >
      > # > > I was just wondering if anyone knew if it's possible to find
      quotation
      > # marks
      > # > > while ignoring quotes inside of tags... Any help on this would go a
      long
      > # way
      > # > > toward helping one of our editors!
      > # > >
      > # > > Thanks,
      > # > >
      > # > > Caroline Cubé
      > # > > Computer Resource Specialist
      > # > > UCLA Library Dept. of Special Collections
      > # > >
      > # > >
      > # > > To unsubscribe click on address below and send the message empty:
      > # > > mailto:notetab-unsubscribe@yahoogroups.com
      > # > > http://groups.yahoo.com/list/notetab
      > # > >
      > # > > Your use of Yahoo! Groups is subject to
      > # http://docs.yahoo.com/info/terms/
      > # >
      > # >
      > # > To unsubscribe click on address below and send the message empty:
      > # > mailto:notetab-unsubscribe@yahoogroups.com
      > # > http://groups.yahoo.com/list/notetab
      > # >
      > # > Your use of Yahoo! Groups is subject to
      http://docs.yahoo.com/info/terms/
      > # >
      > # >
      > #
      > #
      > #
      > # To unsubscribe click on address below and send the message empty:
      > # mailto:notetab-unsubscribe@yahoogroups.com
      > # http://groups.yahoo.com/list/notetab
      > #
      > # Your use of Yahoo! Groups is subject to
      http://docs.yahoo.com/info/terms/
      > #
      > #
      >
      > ,-,
      > /.( pinky@... <")))))))<
      > \ { X65680
      > `-`
      >
      > every act of creativity
      > is first an act of destruction.
      > --- picasso
      >
      >
      >
      >
      > To unsubscribe click on address below and send the message empty:
      > mailto:notetab-unsubscribe@yahoogroups.com
      > http://groups.yahoo.com/list/notetab
      >
      > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
      >
      >
    • Wayne VanWeerthuizen
      ... Well, this is the kind of task that is too complex for NoteTab s regular expression search and replace. It basically requires a programmed loop. Also note
      Message 2 of 9 , Mar 29, 2002
        Caroline asked:
        >I was just wondering if anyone knew if it's possible to find quotation marks
        >while ignoring quotes inside of tags... Any help on this would go a long way
        >toward helping one of our editors!

        And in another message added:
        >The reason we want to find quotes outside of tags
        >is to turn them from straight quotes to smart quotes (&lquo; and &rquo;). I'm a
        >newbie here so forgive me. I guess I should subscribe to the clips list!



        Well, this is the kind of task that is too complex for NoteTab's regular
        expression search and replace. It basically requires a programmed loop.

        Also note that as presented here, this clip will search the entire document
        below the cursor. (If you only want to search and replace in selected text,
        the clip will require several modifications. This is because the Find and
        InsertText commands lose the previous selection.)

        H="Fix Quotes outside of Tags"
        ;### Make sure key variables are reset
        ^!Set %tag%=0
        ^!Set %QT%=0
        :Loop
        ;### Look for our important characters
        ^!Find "[<">]" RS
        ^!IfError EXIT
        ;### Are we inside or outside of a tag?
        ^!IfSame "^$GetChar$" "<" ^!Set %tag%=1
        ^!IfSame "^$GetChar$" ">" ^!Set %tag%=0
        ;### Do we have a double quote?
        ^!IfDiff "^$GetChar$" """ Loop
        ;### Ignore if we are inside of a tag.
        ^!If ^%tag%=1 Loop
        ;### Determine which smart quote to use.
        ^!If ^%QT%=0 LeftQuote ELSE RightQuote
        :LeftQuote
        ^!SET %QT%=1
        ^!InsertText &lquo;
        ^!Goto Loop
        :RightQuote
        ^!SET %QT%=0
        ^!InsertText &rquo;
        ^!Goto Loop
      • Don Passenger
        I woke up thinking (sad isn t it) can I solve this myself ... or do I need to encourage Wayne to pump some caffiene and solve this puppy. To my immense joy
        Message 3 of 9 , Mar 29, 2002
          I woke up thinking (sad isn't it) can I solve this myself ... or do I need
          to encourage Wayne to pump some caffiene and solve this puppy. To my
          immense joy (told you it was sad), Wayne was already here.

          I found a little glitch here though Wayne (which of course may permit an
          explanation of why this isn't quite enough horsepower to really do this
          right ... *grin*)

          I used it on a file that had javascript which then had testing going ... is
          x < y or is x > z ... and then it replaced all of the quotes in the
          javascript outside the numerical testing < >.

          So I suppose to be clean one would also need to disregard from "<script" to
          "/script>" as though the whole block were one tag without finding internal
          greater/less than's.

          Don

          cc: CarOline




          > Caroline asked:
          > >I was just wondering if anyone knew if it's possible to find quotation
          marks
          > >while ignoring quotes inside of tags...
          snip
          > And in another message added:
          > >The reason we want to find quotes outside of tags
          > >is to turn them from straight quotes to smart quotes (&lquo; and &rquo;).

          snip
          > Well, this is the kind of task that is too complex for NoteTab's regular
          > expression search and replace.

          snip

          ;### Make sure key variables are reset
          ^!Set %tag%=0
          ^!Set %QT%=0
          :Loop
          ;### Look for our important characters
          ^!Find "[<">]" RS
          ^!IfError EXIT
          ;### Are we inside or outside of a tag?
          ^!IfSame "^$GetChar$" "<" ^!Set %tag%=1
          ^!IfSame "^$GetChar$" ">" ^!Set %tag%=0
          ;### Do we have a double quote?
          ^!IfDiff "^$GetChar$" """ Loop
          ;### Ignore if we are inside of a tag.
          ^!If ^%tag%=1 Loop
          ;### Determine which smart quote to use.
          ^!If ^%QT%=0 LeftQuote ELSE RightQuote
          :LeftQuote
          ^!SET %QT%=1
          ^!InsertText &lquo;
          ^!Goto Loop
          :RightQuote
          ^!SET %QT%=0
          ^!InsertText &rquo;
          ^!Goto Loop
        • Robert Lombardi II
          First of all I would like to thank Jody for wrestling the dreaded Yahoo into submission so that I might FINALLY be able to post to this group. I started using
          Message 4 of 9 , Mar 29, 2002
            First of all I would like to thank Jody for wrestling the dreaded Yahoo
            into submission so that I might FINALLY be able to post to this group.

            I started using NoteTab almost a year ago but it was only recently that
            I began to fully appreciate the CLIP language that is contained within
            it.

            I must say I am very impressed!! The WORK Benefit to Tim to Learn is
            very high and I am able to do tasks that would normally take hundreds of
            hours by hand in mere minutes.

            My job description is essentially an Engineering Technician responsible
            for the EDA (Electronic Design Automation) Tools that my company uses.
            That means I show Engineers how to use the Schematic Drawing Programs
            and solve their inane problems. The schematics are saved as ASCII
            files. So you can see where NoteTAB is very useful to.

            Here is my quandary that I'm hoping SOMEONE here can help me with.

            In the ASCII files I mentioned are PART NUMBERS for the various
            components used in the schematics that the engineers create. I use
            NoteTAB to sniff out these part numbers from the ASCII files.

            The functionality I would LOVE to add is the ability for NoteTAB to be
            able to take this Part Number and use it to query an ODBC database. Now
            as NoteTAB IS used to do Web Design. I am QUITE SURE there MUST be some
            sort of subroutine to do this. It's just I'm not SAVVY enough with this
            stuff to do it.

            I am currently embroiled in learning PERL and as anyone who has taken up
            PERL would know it DOES have a learning curve despite what anyone tell
            you. I'm sure PERL also has a method of doing what I need but it will
            take me quite a while to get there.

            Anybody have any thoughts/directions on my comments?

            Thanks in advance!

            Robert
          • Don Passenger
            H= Fix Quotes outside of Tags ;*** 3/29/2002 by Wayne (the wizard) waynevanw@attbi.com ;*** and Don (the slug) passenger@alumni.nd.edu ;###go to start of
            Message 5 of 9 , Mar 29, 2002
              H="Fix Quotes outside of Tags"
              ;*** 3/29/2002 by Wayne (the wizard) waynevanw@...
              ;*** and Don (the slug) passenger@...
              ;###go to start of document comment out if unwanted
              ^!SetScreenUpdate Off
              ^!Jump Text_Start
              ;### Make sure key variables are reset
              ^!Set %tag%=0
              ^!Set %QT%=0
              :Loop
              ;### Look for our important characters
              ^!Find "[<">]" RS
              ^!IfError EXIT
              ;### Are we inside or outside of a tag?
              ^!IfSame "^$GetChar$" "<" CheckScript ELSE ResumeLoop
              ;### Skip to end if Javascript etc.
              ; necessary to avoid using math <> as tag ends
              :CheckScript
              ^!Set %tag%=1
              ^!Select +6
              ^!IfDiff "^$GetSelection$" "<script" ResetPos
              ^!Find "/script>" IS
              ^!IfError ^!Prompt Unmatched Script Tag
              ^!Jump SELECT_END
              ^!Set %tag%=0
              ^!GoTo Loop
              ;### Need to reset cursor after checking if script
              :ResetPos
              ^!Jump SELECT_START
              ^!MoveCursor +1
              ^!GoTo Loop
              ;### If not Javascript
              :ResumeLoop
              ^!IfSame "^$GetChar$" ">" ^!Set %tag%=0
              ;### Do we have a double quote?
              ^!IfDiff "^$GetChar$" """ Loop
              ;### Ignore if we are inside of a tag.
              ^!If ^%tag%=1 Loop
              ;### Determine which smart quote to use.
              ^!If ^%QT%=0 LeftQuote ELSE RightQuote
              :LeftQuote
              ^!SET %QT%=1
              ^!InsertText &lquo;
              ^!Goto Loop
              :RightQuote
              ^!SET %QT%=0
              ^!InsertText &rquo;
              ^!Goto Loop


              This seems to work accross scripts. Are there other things like script we
              need to work on?
              I put jump top back in, but it can be commented out. P.S. CarOline, we do
              expect dinner next time we are in LA *grin* ... from your sidekick who will
              save hours. Ain't notetab the cats pajamas?


              --
              Don Passenger
              mailto:dpasseng@...
              home: http://www.iserv.net/~dpasseng
              work: http://www.grcourt.org
              ----- Original Message -----
              From: "Wayne VanWeerthuizen" <waynevanw@...>
              To: <ntb-clips@yahoogroups.com>
              Sent: Friday, March 29, 2002 7:29 AM
              Subject: Re: [Clip] finding/replacing quotes outside of tags


              > Caroline asked:
              > >I was just wondering if anyone knew if it's possible to find quotation
              marks
              > >while ignoring quotes inside of tags... Any help on this would go a long
              way
              > >toward helping one of our editors!
              >
              > And in another message added:
              > >The reason we want to find quotes outside of tags
              > >is to turn them from straight quotes to smart quotes (&lquo; and &rquo;).
              I'm a
              > >newbie here so forgive me. I guess I should subscribe to the clips list!
            • Wayne VanWeerthuizen
              ... Sometimes I don t respond merely because I am busy. Other times I want to give some of the other regulars more opportunity to find and take credit for a
              Message 6 of 9 , Mar 29, 2002
                Don Passenger wrote:

                >I woke up thinking (sad isn't it) can I solve this myself ... or do I need
                >to encourage Wayne to pump some caffiene and solve this puppy. To my
                >immense joy (told you it was sad), Wayne was already here.

                Sometimes I don't respond merely because I am busy. Other times I want
                to give some of the other regulars more opportunity to find and take
                credit for a solution. ;-)

                But I usually only step in when I suspect that the other regular
                contributors are overlooking important techniques or options. Often we
                get so used to solving certain types of problems in certain ways, that
                we forget we have other tools in our toolbox. Before I start
                implementing any solution to any non-trivial problem, I consider what
                other solutions might also be possible and mentally outline each
                approach before picking one.

                But I too often forget certain options. I didn't consider until now
                that the recently added NoteTab clip function, ^$GetHtmlTag$, might be
                of significant help here. One of the first steps we each should have
                taken on this problem was to search NoteTab's clip programming help
                for HTML related commands and functions.

                >I found a little glitch here though Wayne (which of course may permit an
                >explanation of why this isn't quite enough horsepower to really do this
                >right ... *grin*)

                Oh, the horsepower is available. The approach I used in this clip is
                vastly extendable. Just add more tests and more status variables for
                all the situations that need to be accounted for. Of course that is
                highly dependant on the context in the which the clip is to be used. If
                it is used only with plain HTML documents having no embedded scripts,
                then it should work fine as is. To make it work on files containing
                scripts, you need to detect when a script starts and skip over
                everything until the script ends, just as you mentioned.

                But "to really do this right" is not really a well-defined goal. I
                would assume "Right" means it solves some practical need, better than
                any other alternative. Since different people may have different
                needs, what is for one person may not be right for another. If by
                "right" you are thinking of a clip that deals with all concievable
                situations -- I'd be afraid that such a clip would be too slow and
                inefficient to be of much use in a real life. So to do this "right",
                we need to look at examples of the actual files Caroline's friend is
                working with.

                >I used it on a file that had javascript which then had testing going ... is
                >x < y or is x > z ... and then it replaced all of the quotes in the
                >javascript outside the numerical testing < >.

                >So I suppose to be clean one would also need to disregard from "<script" to
                >"/script>" as though the whole block were one tag without finding internal
                >greater/less than's.

                Here is a much improved version of my clip. It is faster, while also
                skipping over <script>....</script> blocks. Note that I changed the
                logic a bit from the earlier clip. No need to find and skip over
                quotes known to be inside of tags, when one can simply skip straight to
                the end the of tag. The ^$GetHtmlTag(TRUE)$ function does the work of
                identifying HTML tags for us.

                (This clip is not much longer than before, although the added comments
                and blank lines may make it appear so.)



                H="Fix Quotes outside of Tags v2"

                :Loop
                ;### Just for debugging: make cursor more visable and pause.
                ;Select -1
                ;Continue

                ;### Search for either < or ".
                ^!Find "[<"]" RS
                ^!IfError EXIT

                ;### %TAG% will be empty if cursor is not inside a tag.
                ^!Set %TAG%="^$GetHtmlTag(TRUE)$"
                ^!IfTrue ^$IsEmpty(^%TAG%)$ NotTag

                ;### So we found a tag. Is it a </SCRIPT> tag?
                ^!IfSame "SCRIPT" "^$GetHtmlTagName("^%TAG%";UPPERCASE)$" SkipScript

                ;### If not, move cursor to end of tag and find next tag or quote.
                ^!Jump SELECT_END
                ^!Goto Loop

                :SkipScript
                ;### If we found a <SCRIPT> tag, find and skip over </SCRIPT> tag.
                ^!Find "</script>" IS
                ^!Jump SELECT_END
                ^!Goto Loop

                :NotTag
                ;### Means we found something that is not a tag.
                ;### Lets be sure it is a quote.
                ^!IfDiff "^$GetChar$" """ Loop

                ;### Since it was a quote, we now decide what to replace it with.
                ^!If ^%QT%=1 EndQuote
                :StartQuote
                ^!SET %QT%=1
                ^!InsertText &lquo;
                ^!Goto Loop
                :EndQuote
                ^!SET %QT%=0
                ^!InsertText &rquo;
                ^!Goto Loop

                ;### End of clip
              • Don Passenger
                v3 now after all this effort, I decide to actually view the result and find that &lquo; and &rquo; aren t the correct codes ... they are “ and ”
                Message 7 of 9 , Mar 29, 2002
                  v3
                  now after all this effort, I decide to actually view the result and find
                  that &lquo; and &rquo; aren't the correct codes ...
                  they are “ and ” for double quote.
                  &147; and &148; of course work fine too.

                  And I keep inserting the
                  ^!SetScreenUpdate Off
                  ^!Jump Text_Start
                  at the beginning too *grin*.

                  Believe it or not I considered the htmltag part Wayne. But then I didn't
                  actually have a clue what to do with it. I am proud when I think about maybe
                  using something even when I don't know how I would actually use it, when I
                  later find you actually use it.

                  The only other likely scenario I can think of for a skip is php script, but
                  there probably are others. Is it faster to run the whole file once for
                  script Wayne and only turn on script check if it exists? I do agree that
                  seeing what the files being worked on consist of will help. Knowing the
                  goal helps a ton, as was obvious from the q&a which got us to open and
                  closing "smart" quotes.


                  ****start copying next line ****
                  H="Replace Quotes Outside Tags v3"
                  ;*** 3/29/2002
                  ;*** written by Wayne (the wizard) waynevanw@...
                  ;*** whacked at by Don (the slug) passenger@...
                  ;###go to start of document comment out if unwanted
                  ^!SetScreenUpdate Off
                  ^!Jump Text_Start

                  :Loop
                  ;### Search for either < or ".
                  ^!Find "[<"]" RS
                  ^!IfError EXIT

                  ;### %TAG% will be empty if cursor is not inside a tag.
                  ^!Set %TAG%="^$GetHtmlTag(TRUE)$"
                  ^!IfTrue ^$IsEmpty(^%TAG%)$ NotTag

                  ;### So we found a tag. Is it a </SCRIPT> tag?
                  ^!IfSame "SCRIPT" "^$GetHtmlTagName("^%TAG%";UPPERCASE)$" SkipScript

                  ;### If not, move cursor to end of tag and find next tag or quote.
                  ^!Jump SELECT_END
                  ^!Goto Loop

                  :SkipScript
                  ;### If we found a <SCRIPT> tag, find and skip over </SCRIPT> tag.
                  ^!Find "</script>" IS
                  ^!Jump SELECT_END
                  ^!Goto Loop

                  :NotTag
                  ;### Means we found something that is not a tag.
                  ;### Lets be sure it is a quote.
                  ^!IfDiff "^$GetChar$" """ Loop

                  ;### Since it was a quote, we now decide what to replace it with.
                  ^!If ^%QT%=1 EndQuote
                  :StartQuote
                  ^!SET %QT%=1
                  ^!InsertText “
                  ^!Goto Loop
                  :EndQuote
                  ^!SET %QT%=0
                  ^!InsertText ”
                  ^!Goto Loop

                  ;### End of clip
                • Jody
                  Hi Robert, ... ^$GetField(number:row)$ I think. ... I don t do ODBC, so I cannot help you further. Import file you edited in NoteTab to ODBC?
                  Message 8 of 9 , Apr 2, 2002
                    Hi Robert,

                    >In the ASCII files I mentioned are PART NUMBERS for the various
                    >components used in the schematics that the engineers create. I
                    >use NoteTAB to sniff out these part numbers from the ASCII files.

                    ^$GetField(number:row)$ I think. <g>

                    >The functionality I would LOVE to add is the ability for NoteTAB
                    >to be able to take this Part Number and use it to query an ODBC
                    >database. Now as NoteTAB IS used to do Web Design. I am QUITE
                    >SURE there MUST be some sort of subroutine to do this. It's just
                    >I'm not SAVVY enough with this stuff to do it.

                    I don't do ODBC, so I cannot help you further. Import file you
                    edited in NoteTab to ODBC? ^$GetField(number:row)$ and then Find
                    in ODBC file?

                    ^!Set %row%=1
                    ^!SetDelimiter ^%tab%

                    :Loop
                    ^!Set %pn%=^$GetField(number:^%row%)$
                    ^!Document Next
                    ^!Find "ODBC file" Grin
                    ^!IfError End
                    ^!InsertText ^%pn%
                    ^!Inc %row%
                    ^!Document Prev
                    ^!Goto Loop

                    Also, check out:

                    ^$GetDocIndex$
                    ^!SetDocIndex
                    ^$GetFileText(...)$
                    ^!SetListDelimiter
                    ^!Save As (path\filename - makes/overwrites without prompt)
                    File | Export

                    Help | Help on Clip Programming

                    Happy Clip'n!
                    Jody

                    http://www.notetab.net

                    Subscribe, UnSubscribe, Options
                    mailto:Ntb-Clips-Subscribe@yahoogroups.com
                    mailto:Ntb-Clips-UnSubscribe@yahoogroups.com
                    http://groups.yahoo.com/group/ntb-clips
                  • Grant Mackenzie
                    ... Hi Although the clip methods for dealing with delimited txt files are great (^$GetField(number:row)$ etc as Jody mentioned) notetab has no native way of
                    Message 9 of 9 , Apr 3, 2002
                      > The functionality I would LOVE to add is the ability for NoteTAB to be
                      > able to take this Part Number and use it to query an ODBC database. Now
                      > as NoteTAB IS used to do Web Design. I am QUITE SURE there MUST be some
                      > sort of subroutine to do this. It's just I'm not SAVVY enough with this
                      > stuff to do it.

                      Hi
                      Although the clip methods for dealing with delimited txt files are great
                      (^$GetField(number:row)$ etc as Jody mentioned) notetab has no native way
                      of accessing databases.
                      However I do work with databases and have found notetab indespensible in
                      writing script to automate data manipulation and access routines.
                      Ms data access components can be found at.
                      http://www.microsoft.com/data/
                      Download the latest mdac release. now 2.7
                      To access database data I use the ADO com object instantiated in the Window
                      Script Host
                      COM objects are language nuetral so you can use your favourite language to
                      instantiate theADO object and use it's properties and methods.
                      The active PERL disttribution last time I looked had some example ADO and
                      WSH examples.

                      Since script is run in the console and has no gui
                      I use notetabs getout method to both run and get the output from the script
                      host
                      ^$getoutput()$
                      and I also pass arguments to the script using the same method.
                      The argument in your case would be the Part Number

                      ;the location of script to run
                      ^!Set %file%="^$GetScriptPath$ado.js"
                      ;get rid of logo
                      ^!Set %hostOptions%=^$StrFill(/;2)$nologo
                      ^!Set %arg%="Part Number"
                      ^!INFO ^$GetOutput(Wscript "^%file%" "^%hostOptions%" ^%arg%)$

                      The actual ado script would go something like this.
                      Instantiate ADO object
                      Connect to database use dns-less connection string
                      Contruct SQL string
                      Execute the SQL statement
                      Close connection

                      And would be written in whatever scripting language you pefer.
                    Your message has been successfully submitted and would be delivered to recipients shortly.