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

Re: [Clip] Clip to strip URL's only

Expand Messages
  • Don Daugherty
    ... I use the following ^!Jump Text_Start ... ^!Find href= TIS ^!IfError End ^!Select HTMLTag ^!InsertText ^%Empty% ^!GoTo HTMLs ... Try it out on a sample
    Message 1 of 14 , Aug 27, 2004
    • 0 Attachment
      > I need a clip to strip URL's from an HTML document and leave the
      > rest of the HTML formatting intact. I tried to write one myself but
      > made a totall mess so far. I am not experienced enough. Does anyone
      > have such a clip ready and/or can anyone give me an advice how to
      > create one?

      I use the following

      ^!Jump Text_Start
      :HTMLs
      ^!Find " href=" TIS
      ^!IfError End
      ^!Select HTMLTag
      ^!InsertText ^%Empty%
      ^!GoTo HTMLs
      :End

      Try it out on a sample or two and see if it gives what you want
    • manon_purple
      Thanks, great, this is good for learning, I see what I did wrong: the ^%Empty% did the trick. Another option I try to insert is a !Set %Range% to execute the
      Message 2 of 14 , Aug 27, 2004
      • 0 Attachment
        Thanks, great, this is good for learning, I see what I did wrong:
        the ^%Empty% did the trick.
        Another option I try to insert is a !Set %Range% to execute the
        strip URL clip only on a selection. No luck so far, I mess that one
        up. Any idea/help most welcome, this is a great way to learn.

        Thank you for your help!

        --- In ntb-clips@yahoogroups.com, "Don Daugherty" <daugherty@k...>
        wrote:
        > I use the following
        >
        > ^!Jump Text_Start
        > :HTMLs
        > ^!Find " href=" TIS
        > ^!IfError End
        > ^!Select HTMLTag
        > ^!InsertText ^%Empty%
        > ^!GoTo HTMLs
        > :End
        >
        > Try it out on a sample or two and see if it gives what you want
      • manon_purple
        Meanwhile I found out that !Set %Range% was not very clever of me, neither was $GetSelections and other things I tried. ;-) I use a ^!Jump Select_Start now
        Message 3 of 14 , Aug 28, 2004
        • 0 Attachment
          Meanwhile I found out that !Set %Range% was not very clever of me,
          neither was $GetSelections and other things I tried. ;-)
          I use a ^!Jump Select_Start now that works fine for beginning, but
          where should I put the Select_End (or whatever) to let the function
          operate only on the selection? Yes, I am an absolute beginner, only
          very simple clips so far.
          Thanks for your attention!

          --- In ntb-clips@yahoogroups.com, "manon_purple" <manon_purple@y...>
          wrote:
          > Thanks, great, this is good for learning, I see what I did wrong:
          > the ^%Empty% did the trick.
          > Another option I try to insert is a !Set %Range% to execute the
          > strip URL clip only on a selection. No luck so far, I mess that
          one
          > up. Any idea/help most welcome, this is a great way to learn.
          >
          > Thank you for your help!
        • melchior prisi
          Hi, ... You might read the Help file about the commands ^$getrowstart$ and ^$getrowend$. Select something, then ^!set %end%=^$getrowend$ and let the clip stop
          Message 4 of 14 , Aug 28, 2004
          • 0 Attachment
            Hi,

            ----- on 28.08.2004 09:13 manon_purple wrote:

            > I use a ^!Jump Select_Start now that works fine for beginning, but
            > where should I put the Select_End (or whatever) to let the function
            > operate only on the selection? Yes, I am an absolute beginner, only
            > very simple clips so far.
            > Thanks for your attention!

            You might read the Help file about the commands
            ^$getrowstart$ and ^$getrowend$.


            Select something, then
            ^!set %end%=^$getrowend$

            and let the clip stop by
            ^!if ^$getrow$ >= ^%end% exit

            BTW: There are also ^$getcolstart$ and ^$getcolend$


            Regards,

            Melchior





            --
            http://loc.alphazwirbel.net
            http://orp.alphazwirbel.net
          • manon_purple
            Thanks, got it, works perfect!!
            Message 5 of 14 , Aug 28, 2004
            • 0 Attachment
              Thanks, got it, works perfect!!

              --- In ntb-clips@yahoogroups.com, melchior prisi <mprisi@s...> wrote:
              > Hi,
              > You might read the Help file about the commands
              > ^$getrowstart$ and ^$getrowend$.
              >
              >
              > Select something, then
              > ^!set %end%=^$getrowend$
              >
              > and let the clip stop by
              > ^!if ^$getrow$ >= ^%end% exit
              >
              > BTW: There are also ^$getcolstart$ and ^$getcolend$
              >
              >
              > Regards,
              >
              > Melchior
              >
              >
              >
              >
              >
              > --
              > http://loc.alphazwirbel.net
              > http://orp.alphazwirbel.net
            • Don Daugherty
              ... If you want to limit ^!Find and or ^!Replace operations to a particular section of a document, you can Find something at the very beginning of that
              Message 6 of 14 , Aug 28, 2004
              • 0 Attachment
                > Meanwhile I found out that !Set %Range% was not very clever of me,
                > neither was $GetSelections and other things I tried. ;-)
                > I use a ^!Jump Select_Start now that works fine for beginning, but
                > where should I put the Select_End (or whatever) to let the function
                > operate only on the selection?

                If you want to limit ^!Find and or ^!Replace operations to a particular
                section of a document,
                you can Find something at the very beginning of that section, use ^!Jump
                Select_Start, and use
                ^!Set %MyStart%=^$GetRow$:^$GetCol$ to "remember" where the beginning is.

                Next Find something at the very end of that section, preferably something
                that won't want to change so you can use the same search criterion if you
                need to search for it again. Then ^!Jump Select_End, followed by
                ^!Set %MyFinish%=^$GetRow$:^$GetCol$ to "remember" where the end is.

                Next use
                ^!SetCursor ^%MyStart%
                ^!SelectTo ^%MyFinish%
                to select the section in question.

                Now you can carryout a more specific !Find or !Replace operation using the H
                option to limit the search and/or replace operation to the section.

                If you need to make more than one change within the section, you'll probably
                need to refresh the definition of %MyFinish%, since adding or deleting
                characters within the section would change the true row:col address of the
                end of the section. After refreshing, again use
                ^!SetCursor ^%MyStart%
                ^!SelectTo ^%MyFinish%
                to select the section in question. Then make you next change involving a
                Find/Replace operations.
              • manon_purple
                Hi Don, Thank you very much. These notes are very instructive. I though I found the solution with Melchior s advise, but that was only partially, the function
                Message 7 of 14 , Aug 29, 2004
                • 0 Attachment
                  Hi Don,
                  Thank you very much. These notes are very instructive. I though I
                  found the solution with Melchior's advise, but that was only
                  partially, the function I created only worked on the first part of
                  the selection.
                  I am still struggling. If I want to do another search-replace or
                  insert I currently call another clip, that is not a clean way of
                  programming, but it works for the time being.
                  However, working on selections is still troublesome. One time I
                  think I have it to conclude the next moment it is still not working
                  the way I want it. If you (or anyone) could post a full example of a
                  function operating on a selection I would be most grateful. I learn
                  from examples and tear apart the clips I have found on the internet
                  so far, but I did not find an example of working on a selection.

                  By the way, what does TIS mean in your code, this maybe a stupid
                  question but I have searched the Help file and could not find it and
                  searching on the seperate items T or I or S gave too many hits to be
                  useful. The code seems to work without it as well.

                  Thank you so much for your help!
                  Best wishes
                  manon

                  --- In ntb-clips@yahoogroups.com, "Don Daugherty" <daugherty@k...>
                  wrote:
                  > If you want to limit ^!Find and or ^!Replace operations to a
                  particular
                  > section of a document,
                  > you can Find something at the very beginning of that section, use
                  ^!Jump
                  > Select_Start, and use
                  > ^!Set %MyStart%=^$GetRow$:^$GetCol$ to "remember" where the
                  beginning is.
                  ==SNIPPED lots of good instructions for sake of brevity==
                • Don Daugherty
                  ... I don t know if I have any tested examples. I ll look around and reply again if I find one. ... TIS is a set of options that apply to ^!Find and ^!Replace
                  Message 8 of 14 , Aug 30, 2004
                  • 0 Attachment
                    > If you (or anyone) could post a full example of a
                    > function operating on a selection I would be most grateful. I learn
                    > from examples and tear apart the clips I have found on the internet
                    > so far, but I did not find an example of working on a selection.
                    >
                    I don't know if I have any tested examples. I'll look around and reply
                    again if I find one.

                    > By the way, what does TIS mean in your code, this maybe a stupid
                    > question but I have searched the Help file and could not find it and
                    > searching on the seperate items T or I or S gave too many hits to be
                    > useful. The code seems to work without it as well.
                    >
                    TIS is a set of options that apply to ^!Find and ^!Replace operations. They
                    are found under those commands in the Help menu for Clip Programming. "T"
                    probably isn't needed, "I" is for case independence, and "S" is for "silent"
                    execution, i.e., no interruptions by message boxes.
                  • manon_purple
                    Thanks very much Don! ... reply ... operations. They ... Programming. T ... for silent
                    Message 9 of 14 , Sep 1, 2004
                    • 0 Attachment
                      Thanks very much Don!
                      --- In ntb-clips@yahoogroups.com, "Don Daugherty" <daugherty@k...>
                      wrote:
                      > I don't know if I have any tested examples. I'll look around and
                      reply
                      > again if I find one.
                      > TIS is a set of options that apply to ^!Find and ^!Replace
                      operations. They
                      > are found under those commands in the Help menu for Clip
                      Programming. "T"
                      > probably isn't needed, "I" is for case independence, and "S" is
                      for "silent"
                      > execution, i.e., no interruptions by message boxes.
                    • Don Daugherty
                      ... again if I find one. You re welcome. I do have an example to look at. Let me know if you need it posted.
                      Message 10 of 14 , Sep 2, 2004
                      • 0 Attachment
                        > Thanks very much Don!
                        > --- In ntb-clips@yahoogroups.com, "Don Daugherty" <daugherty@k...>
                        > wrote:
                        > > I don't know if I have any tested examples. I'll look around and reply
                        again if I find one.

                        You're welcome. I do have an example to look at. Let me know if you need
                        it posted.
                      • manon_purple
                        Hi Don, Yes please post. Thanks very much in advance! ... you need
                        Message 11 of 14 , Sep 7, 2004
                        • 0 Attachment
                          Hi Don, Yes please post. Thanks very much in advance!

                          --- In ntb-clips@yahoogroups.com, "Don Daugherty" <daugherty@k...>
                          wrote:
                          > You're welcome. I do have an example to look at. Let me know if
                          you need
                          > it posted.
                        • Don Daugherty
                          ... Ok, here goes. The example clip that does the loading and editing is this: ; The following Open command needs to point to the correct location of the
                          Message 12 of 14 , Sep 8, 2004
                          • 0 Attachment
                            > Hi Don, Yes please post. Thanks very much in advance!
                            >

                            Ok, here goes. The example clip that does the loading and editing is this:

                            ; The following "Open" command needs to point to the correct location of the
                            library in question.
                            ; Most users probably would have it on drive c:\, not d:\
                            ^!Open "D:\Program Files\NoteTab Pro\Libraries\Test_Library.clb"
                            ; Define %MyStart%, i.e., find and "label" start of desired section (of
                            clip)
                            ^!Find "H=\"_OpenQPW\"\n" R
                            ^!Jump Select_End
                            ^!Set %MyStart%=^$GetRow$:^$GetCol$
                            ; Define %MyFinish%, i.e., find and "label" finish of desired section (of
                            clip), and then Select the section.
                            ; If you expect to carry-out more than one search/replace operation, the
                            following
                            ; six lines would best be placed in a separate clip and called via the
                            ^!Clip command.
                            ^!SetCursor ^%MyStart%
                            ^!Find "H=\"" R
                            ^!Jump Select_Start
                            ^!Set %MyFinish%=^$GetRow$:^$GetCol$
                            ^!SetCursor ^%MyStart%
                            ^!SelectTo ^%MyFinish%
                            ; Carry out desired search/replace
                            ^!Replace "KeyboardDelay 20" >> "Change-1^P" HA
                            ; If you have additional search/replace operations to perform,
                            ; rerun the six-line routine that defines %MyFinish% and selects the
                            section.
                            ; Carry out next desired search and replace
                            ; ...
                            ^!Close Save
                            :End

                            The Library being edited (viewed as a document) is as follows:

                            = V5 MultiLine NoSorting TabWidth=30

                            H="Open Finance 2004"
                            ^!Clip "OpenQPW" Finance2004.qpw


                            H="Open Finance 2003"
                            ^!Clip "OpenQPW" Finance2003.qpw


                            H="OpenInvestments"
                            ^!Clip "OpenQPW" Investments.qpw

                            H="_OpenQPW"
                            ^!Set %Program%="D:\Program Files\Corel\WordPerfect Office
                            2002\Programs\QPW.exe"
                            ^!Set %TBar%="Quattro*"
                            ^!Set %Specific%="modified"
                            ^!Clip "OpenOrFocusApp"
                            ;KeyboardDelay 20
                            ^!KeyboardDelay 20
                            ;KeyboardDelay 20
                            ;KeyboardDelay 20
                            ;KeyboardDelay 20
                            ^!Keyboard Ctrl+O
                            ^!Delay 2
                            ^!IfMatch "Open\sFile.*" "^$GetAppTitle$" Next Else Skip_-1
                            ^!Keyboard #e:\MySpreadsheets\Finance\^&# Enter
                            ^!Delay 2
                            ^!IfMatch "Hotlinks" "^$GetAppTitle$" Next Else Skip_-1
                            ^!Keyboard u Enter
                            ^!Delay 10
                            ^!Keyboard ALT+F2 #NonAutoBegin# Enter
                            ^!MinimizeApp
                            ^!FocusApp "^%TBar%"


                            H="Get Market Data"
                            ;KeyboardDelay 20
                            ;KeyboardDelay 20
                            ;KeyboardDelay 20
                            ;KeyboardDelay 20
                            ^!Set %Path%="e:\MySpreadsheets\Finance\"
                            ^!Clip "Choices"
                            ^!If ^%Yahoo%>0 Next Else Skip
                            ^!Clip "Get Yahoo"
                            ^!If ^%Tnavs%>0 Next Else Skip
                            ^!Clip "Get Cref NAVs"
                            ^!If ^%Rrate%>0 Next Else Skip
                            ^!Clip "Get Rukeyser Ratings"
                            ^!If ^%Trate%>0 Next Else Skip
                            ^!Clip "Get Cref Ratings"
                            ^!If ^%M500%>0 Next Else Skip
                            ^!Clip "Get Morningstar 500"
                            ^!If ^%M2042%>0 Next Else Skip
                            ^!Clip "Get Morningstar 2042"
                            ^!Continue Process Market Data now?
                            ^!Clip "Process Market Data"
                            :End

                            ;KeyboardDelay 20
                            ;KeyboardDelay 20
                            ;KeyboardDelay 20
                          • manon_purple
                            Don, thanks very much. A good one for learning and experimenting with!
                            Message 13 of 14 , Sep 10, 2004
                            • 0 Attachment
                              Don, thanks very much. A good one for learning and experimenting
                              with!

                              --- In ntb-clips@yahoogroups.com, "Don Daugherty" <daugherty@k...>
                              wrote:
                              > > Hi Don, Yes please post. Thanks very much in advance!
                              > >
                              >
                              > Ok, here goes. The example clip that does the loading and editing
                              is this:
                              >
                            • Robert
                              Uh ... sorry for this posting on the wrong list. I am on both lists. I have no clue how I did that! I have experienced a senior moment. It isn t fun. Anyway
                              Message 14 of 14 , Sep 10, 2004
                              • 0 Attachment
                                Uh ... sorry for this posting on the wrong list. I am on both lists. I have
                                no clue how I did that!

                                I have experienced a senior moment. It isn't fun.

                                Anyway ... thanks in advance if you have a clip that will do this.

                                I have two tab delimited database files, a master list, and another "new"
                                list. I need to take the entries that are present in both lists out of the
                                "new" list, leaving all the other entries intact, and not doing anything to
                                the master list.

                                Thanks in advance, and again, sorry for posting to the wrong list.

                                --Robert

                                > I need to remove all the lines in File B that exist in File A, leaving the
                                > rest of File B intact.

                                I have a clip that might do what you want, but we really should move this to
                                the clips list. Are you on that list? If so I'll reply on it.
                              Your message has been successfully submitted and would be delivered to recipients shortly.