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

title varible

Expand Messages
  • tom thomas
    I am creating data files from articles. I am using the title of the article as a variable and using the following clip to create the variable ^!Replace !
    Message 1 of 12 , Oct 9, 2009
    • 0 Attachment
      I am creating data files from articles. I am using the title of the
      article as a variable and using the following clip to create the variable

      ^!Replace "!" >> "" HWAS
      ^!Replace "." >> "" HWAS
      ^!Replace "," >> "" HWAS
      ^!Replace "?" >> "" HWAS
      ^!Replace " " >> "" HWAS
      ^!IfError End
      ^!Goto Skip_-2

      What I have been doing is copy/paste the title, then using the clip
      on the pasted line. What I would like to do is simply highlight the
      title and run the clip. The clip would copy the title and paste the
      results above the title. Example

      This Is My Title

      Running clip would produce this

      ThisIsMyTitle
      This Is My Title

      Thanks,
      Tom Thomas
    • Sheri
      ... Try the following. It will work with the selection, but if nothing is selected, it will use the text on the current line. It needs at least version 5.7 for
      Message 2 of 12 , Oct 9, 2009
      • 0 Attachment
        --- In ntb-clips@yahoogroups.com, tom thomas <tom@...> wrote:
        >
        > I am creating data files from articles. I am using the title of the
        > article as a variable and using the following clip to create the variable
        >
        > ^!Replace "!" >> "" HWAS
        > ^!Replace "." >> "" HWAS
        > ^!Replace "," >> "" HWAS
        > ^!Replace "?" >> "" HWAS
        > ^!Replace " " >> "" HWAS
        > ^!IfError End
        > ^!Goto Skip_-2
        >
        > What I have been doing is copy/paste the title, then using the clip
        > on the pasted line. What I would like to do is simply highlight the
        > title and run the clip. The clip would copy the title and paste the
        > results above the title. Example
        >
        > This Is My Title
        >
        > Running clip would produce this
        >
        > ThisIsMyTitle
        > This Is My Title
        >
        > Thanks,
        > Tom Thomas
        >

        Try the following. It will work with the selection, but if nothing is selected, it will use the text on the current line. It needs at least version 5.7 for ^$GetDocReplaceAll. Current NoteTab version is 6.12.

        ^!If ^$GetSelSize$=0 Next Else Skip_2
        ^!MoveCursor ^%GetRow%:0
        ^!Select EOL
        ^!Set %mod%=^$GetDocReplaceAll("[!\x20.,?]+";"")$
        ^!Jump Select_Start
        ^!InsertText ^%mod%^%NL%
        ^!ClearVariable %mod%
        ;end of clip

        Regards,
        Sheri
      • Sheri
        Sorry make that: ^!If ^$GetSelSize$=0 Next Else Skip_2 ^!SetCursor ^$GetRow$:1 ^!Select EOL ^!Set %mod%=^$GetDocReplaceAll( [! x20.,?]+ ; )$ ^!Jump
        Message 3 of 12 , Oct 9, 2009
        • 0 Attachment
          Sorry make that:

          ^!If ^$GetSelSize$=0 Next Else Skip_2
          ^!SetCursor ^$GetRow$:1
          ^!Select EOL
          ^!Set %mod%=^$GetDocReplaceAll("[!\x20.,?]+";"")$
          ^!Jump Select_Start
          ^!InsertText ^%mod%^%NL%
          ^!ClearVariable %mod%
          ^!Goto End
          ;end of clip

          Regards,
          Sheri
        • tom thomas
          I get an error for this line ^!Set %mod%=^$GetDocReplaceAll( [! x20.,?]+ ; )$ Tom
          Message 4 of 12 , Oct 9, 2009
          • 0 Attachment
            I get an error for this line

            ^!Set %mod%=^$GetDocReplaceAll("[!\x20.,?]+";"")$

            Tom

            At 05:45 PM 10/9/2009, you wrote:
            >
            >
            >
            >
            >--- In
            ><mailto:ntb-clips%40yahoogroups.com>ntb-clips@yahoogroups.com, tom
            >thomas <tom@...> wrote:
            > >
            > > I am creating data files from articles. I am using the title of the
            > > article as a variable and using the following clip to create the variable
            > >
            > > ^!Replace "!" >> "" HWAS
            > > ^!Replace "." >> "" HWAS
            > > ^!Replace "," >> "" HWAS
            > > ^!Replace "?" >> "" HWAS
            > > ^!Replace " " >> "" HWAS
            > > ^!IfError End
            > > ^!Goto Skip_-2
            > >
            > > What I have been doing is copy/paste the title, then using the clip
            > > on the pasted line. What I would like to do is simply highlight the
            > > title and run the clip. The clip would copy the title and paste the
            > > results above the title. Example
            > >
            > > This Is My Title
            > >
            > > Running clip would produce this
            > >
            > > ThisIsMyTitle
            > > This Is My Title
            > >
            > > Thanks,
            > > Tom Thomas
            > >
            >
            >Try the following. It will work with the selection, but if nothing
            >is selected, it will use the text on the current line. It needs at
            >least version 5.7 for ^$GetDocReplaceAll. Current NoteTab version is 6.12.
            >
            >^!If ^$GetSelSize$=0 Next Else Skip_2
            >^!MoveCursor ^%GetRow%:0
            >^!Select EOL
            >^!Set %mod%=^$GetDocReplaceAll("[!\x20.,?]+";"")$
            >^!Jump Select_Start
            >^!InsertText ^%mod%^%NL%
            >^!ClearVariable %mod%
            >;end of clip
            >
            >Regards,
            >Sheri
            >
            >
          • Sheri
            ... Then you must be running an older version of NoteTab. You should update. Regards, Sheri
            Message 5 of 12 , Oct 9, 2009
            • 0 Attachment
              --- In ntb-clips@yahoogroups.com, tom thomas <tom@...> wrote:
              >
              > I get an error for this line
              >
              > ^!Set %mod%=^$GetDocReplaceAll("[!\x20.,?]+";"")$
              >
              > Tom

              Then you must be running an older version of NoteTab. You should update.

              Regards,
              Sheri
            • tom thomas
              This does the same as my clip ^!If ^$GetSelSize$=0 Next Else Skip_2 ^!MoveCursor ^%GetRow%:0 ^!Select EOL ^!Set %mod%=^$GetDocMatchAll( [! x20.,?]+ ; )$
              Message 6 of 12 , Oct 9, 2009
              • 0 Attachment
                This does the same as my clip

                ^!If ^$GetSelSize$=0 Next Else Skip_2
                ^!MoveCursor ^%GetRow%:0
                ^!Select EOL
                ^!Set %mod%=^$GetDocMatchAll("[!\x20.,?]+";"")$
                ^!Jump Select_Start
                ^!InsertText ^%mod%^%NL%
                ^!ClearVariable %mod%
                ;end of clip

                The original is not there.

                And NoteTab Pro 5.1

                Thanks,
                Tom



                At 06:16 PM 10/9/2009, you wrote:
                >
                >
                >
                >
                >--- In
                ><mailto:ntb-clips%40yahoogroups.com>ntb-clips@yahoogroups.com, tom
                >thomas <tom@...> wrote:
                > >
                > > I get an error for this line
                > >
                > > ^!Set %mod%=^$GetDocReplaceAll("[!\x20.,?]+";"")$
                > >
                > > Tom
                >
                >Then you must be running an older version of NoteTab. You should update.
                >
                >Regards,
                >Sheri
                >
                >
              • Sheri
                ... I posted a correction. the line: ^!MoveCursor ^%GetRow%:0 should be: ^!SetCursor ^%GetRow%:1 Using ^$GetDocMatchAll can t possibly do what you want, it
                Message 7 of 12 , Oct 9, 2009
                • 0 Attachment
                  --- In ntb-clips@yahoogroups.com, tom thomas <tom@...> wrote:
                  >
                  > This does the same as my clip
                  >
                  > ^!If ^$GetSelSize$=0 Next Else Skip_2
                  > ^!MoveCursor ^%GetRow%:0
                  > ^!Select EOL
                  > ^!Set %mod%=^$GetDocMatchAll("[!\x20.,?]+";"")$
                  > ^!Jump Select_Start
                  > ^!InsertText ^%mod%^%NL%
                  > ^!ClearVariable %mod%
                  > ;end of clip
                  >
                  > The original is not there.
                  >
                  > And NoteTab Pro 5.1
                  >
                  > Thanks,
                  > Tom

                  I posted a correction.

                  the line:
                  ^!MoveCursor ^%GetRow%:0
                  should be:
                  ^!SetCursor ^%GetRow%:1

                  Using ^$GetDocMatchAll can't possibly do what you want, it would produce a string separated by semicolons of the runs of exclamation points, etc. The clip would insert that string with a line break in front of the selection.

                  ^$GetDocReplaceAll was introduced in version 5.7.

                  Current NoteTab version is 6.12. It should be a free update from 5.1.

                  There have been many improvements and bug fixes since 5.1.

                  Regards,
                  Sheri
                • flo.gehrke
                  ... Tom, I think Sheri gave you a perfect solution -- if run with the latest version. Here s another idea that possibly works with v5.1. Regarding your
                  Message 8 of 12 , Oct 9, 2009
                  • 0 Attachment
                    --- In ntb-clips@yahoogroups.com, tom thomas <tom@...> wrote:
                    >
                    > I get an error for this line
                    >
                    > ^!Set %mod%=^$GetDocReplaceAll("[!\x20.,?]+";"")$

                    Tom,

                    I think Sheri gave you a perfect solution -- if run with the latest version. Here's another idea that possibly works with v5.1.

                    Regarding your ^!Replace commands: Combining H and W makes no sense. Either it's W (whole document) or H (highlighted text only). In this case, I think you mean H.

                    Line #5 in your clip removes spaces. But I understand they must not be removed from the original titel.

                    The following clip will turn any line like...

                    This, is. my? title!

                    into...

                    Thisismytitle
                    This is my title


                    ^!IfEmpty ^$GetSelection$ Next Else Skip_2
                    ^!Info There's nothing selected!
                    ^!Goto End
                    ; Remove punctuation marks but no spaces
                    ^!Replace "[[:punct:]]" >> "" HARS
                    ; Remove spaces from selection
                    ^!SetClipboard ^$StrReplace(" ";"";^$GetSelection$;0;0)$
                    ^!Jump Line_Start
                    ^!InsertText ^$GetClipboard$^P


                    Regards,
                    Flo
                  • tom thomas
                    Yes, you are right. I created a new clip from yours, but I think I click my old one by mistake, thinking it was yours. Tom
                    Message 9 of 12 , Oct 9, 2009
                    • 0 Attachment
                      Yes, you are right. I created a new clip from yours, but I think I
                      click my old one by mistake, thinking it was yours.

                      Tom

                      At 06:52 PM 10/9/2009, you wrote:
                      >
                      >
                      >
                      >
                      >--- In
                      ><mailto:ntb-clips%40yahoogroups.com>ntb-clips@yahoogroups.com, tom
                      >thomas <tom@...> wrote:
                      > >
                      > > This does the same as my clip
                      > >
                      > > ^!If ^$GetSelSize$=0 Next Else Skip_2
                      > > ^!MoveCursor ^%GetRow%:0
                      > > ^!Select EOL
                      > > ^!Set %mod%=^$GetDocMatchAll("[!\x20.,?]+";"")$
                      > > ^!Jump Select_Start
                      > > ^!InsertText ^%mod%^%NL%
                      > > ^!ClearVariable %mod%
                      > > ;end of clip
                      > >
                      > > The original is not there.
                      > >
                      > > And NoteTab Pro 5.1
                      > >
                      > > Thanks,
                      > > Tom
                      >
                      >I posted a correction.
                      >
                      >the line:
                      >^!MoveCursor ^%GetRow%:0
                      >should be:
                      >^!SetCursor ^%GetRow%:1
                      >
                      >Using ^$GetDocMatchAll can't possibly do what you want, it would
                      >produce a string separated by semicolons of the runs of exclamation
                      >points, etc. The clip would insert that string with a line break in
                      >front of the selection.
                      >
                      >^$GetDocReplaceAll was introduced in version 5.7.
                      >
                      >Current NoteTab version is 6.12. It should be a free update from 5.1.
                      >
                      >There have been many improvements and bug fixes since 5.1.
                      >
                      >Regards,
                      >Sheri
                      >
                      >
                    • tom thomas
                      I upgraded, no errors, but still does not work This This Is My Title Becomes this ; ; This Is My Title Clip code: ^!If ^$GetSelSize$=0 Next Else Skip_2
                      Message 10 of 12 , Oct 9, 2009
                      • 0 Attachment
                        I upgraded, no errors, but still does not work

                        This

                        This Is My Title

                        Becomes this

                        ; ;
                        This Is My Title


                        Clip code:

                        ^!If ^$GetSelSize$=0 Next Else Skip_2
                        ^!SetCursor ^%GetRow%:1
                        ^!Select EOL
                        ^!Set %mod%=^$GetDocMatchAll("[!\x20.,?]+";"")$
                        ^!Jump Select_Start
                        ^!InsertText ^%mod%^%NL%
                        ^!ClearVariable %mod%
                        ;end of clip

                        Thanks,
                        Tom Thomas

                        At 06:52 PM 10/9/2009, you wrote:
                        >
                        >
                        >
                        >
                        >--- In
                        ><mailto:ntb-clips%40yahoogroups.com>ntb-clips@yahoogroups.com, tom
                        >thomas <tom@...> wrote:
                        > >
                        > > This does the same as my clip
                        > >
                        > > ^!If ^$GetSelSize$=0 Next Else Skip_2
                        > > ^!MoveCursor ^%GetRow%:0
                        > > ^!Select EOL
                        > > ^!Set %mod%=^$GetDocMatchAll("[!\x20.,?]+";"")$
                        > > ^!Jump Select_Start
                        > > ^!InsertText ^%mod%^%NL%
                        > > ^!ClearVariable %mod%
                        > > ;end of clip
                        > >
                        > > The original is not there.
                        > >
                        > > And NoteTab Pro 5.1
                        > >
                        > > Thanks,
                        > > Tom
                        >
                        >I posted a correction.
                        >
                        >the line:
                        >^!MoveCursor ^%GetRow%:0
                        >should be:
                        >^!SetCursor ^%GetRow%:1
                        >
                        >Using ^$GetDocMatchAll can't possibly do what you want, it would
                        >produce a string separated by semicolons of the runs of exclamation
                        >points, etc. The clip would insert that string with a line break in
                        >front of the selection.
                        >
                        >^$GetDocReplaceAll was introduced in version 5.7.
                        >
                        >Current NoteTab version is 6.12. It should be a free update from 5.1.
                        >
                        >There have been many improvements and bug fixes since 5.1.
                        >
                        >Regards,
                        >Sheri
                        >
                        >
                      • tom thomas
                        Silly me, I copied from my own email message instead of yours. Your original clip works ^!If ^$GetSelSize$=0 Next Else Skip_2 ^!SetCursor ^$GetRow$:1 ^!Select
                        Message 11 of 12 , Oct 9, 2009
                        • 0 Attachment
                          Silly me, I copied from my own email message instead of yours. Your
                          original clip works

                          ^!If ^$GetSelSize$=0 Next Else Skip_2
                          ^!SetCursor ^$GetRow$:1
                          ^!Select EOL
                          ^!Set %mod%=^$GetDocReplaceAll("[!\x20.,?]+";"")$
                          ^!Jump Select_Start
                          ^!InsertText ^%mod%^%NL%
                          ^!ClearVariable %mod%
                          ^!Goto End
                          ;end of clip

                          Results

                          ThisIsMyTitle
                          This Is My Title


                          That's what I want.

                          Thanks,
                          Tom Thomas


                          At 06:52 PM 10/9/2009, you wrote:
                          >
                          >
                          >
                          >
                          >--- In
                          ><mailto:ntb-clips%40yahoogroups.com>ntb-clips@yahoogroups.com, tom
                          >thomas <tom@...> wrote:
                          > >
                          > > This does the same as my clip
                          > >
                          > > ^!If ^$GetSelSize$=0 Next Else Skip_2
                          > > ^!MoveCursor ^%GetRow%:0
                          > > ^!Select EOL
                          > > ^!Set %mod%=^$GetDocMatchAll("[!\x20.,?]+";"")$
                          > > ^!Jump Select_Start
                          > > ^!InsertText ^%mod%^%NL%
                          > > ^!ClearVariable %mod%
                          > > ;end of clip
                          > >
                          > > The original is not there.
                          > >
                          > > And NoteTab Pro 5.1
                          > >
                          > > Thanks,
                          > > Tom
                          >
                          >I posted a correction.
                          >
                          >the line:
                          >^!MoveCursor ^%GetRow%:0
                          >should be:
                          >^!SetCursor ^%GetRow%:1
                          >
                          >Using ^$GetDocMatchAll can't possibly do what you want, it would
                          >produce a string separated by semicolons of the runs of exclamation
                          >points, etc. The clip would insert that string with a line break in
                          >front of the selection.
                          >
                          >^$GetDocReplaceAll was introduced in version 5.7.
                          >
                          >Current NoteTab version is 6.12. It should be a free update from 5.1.
                          >
                          >There have been many improvements and bug fixes since 5.1.
                          >
                          >Regards,
                          >Sheri
                          >
                          >
                        • Sheri
                          ... Great, glad you got it! ... I see I had again typed it with percents instead of dollar signs. Sorry about that. ^!Jump Line_Start would have been a better
                          Message 12 of 12 , Oct 10, 2009
                          • 0 Attachment
                            --- In ntb-clips@yahoogroups.com, tom thomas <tom@...> wrote:
                            >
                            > Silly me, I copied from my own email message instead of yours. Your
                            > original clip works
                            >
                            > ^!If ^$GetSelSize$=0 Next Else Skip_2
                            > ^!SetCursor ^$GetRow$:1
                            > ^!Select EOL
                            > ^!Set %mod%=^$GetDocReplaceAll("[!\x20.,?]+";"")$
                            > ^!Jump Select_Start
                            > ^!InsertText ^%mod%^%NL%
                            > ^!ClearVariable %mod%
                            > ^!Goto End
                            > ;end of clip
                            >
                            > Results
                            >
                            > ThisIsMyTitle
                            > This Is My Title
                            >
                            >
                            > That's what I want.
                            >
                            > Thanks,
                            > Tom Thomas

                            Great, glad you got it!

                            > >
                            > >I posted a correction.
                            > >
                            > >the line:
                            > >^!MoveCursor ^%GetRow%:0
                            > >should be:
                            > >^!SetCursor ^%GetRow%:1


                            I see I had again typed it with percents instead of dollar signs. Sorry about that.

                            ^!Jump Line_Start

                            would have been a better way to do that.

                            Regards,
                            Sheri
                          Your message has been successfully submitted and would be delivered to recipients shortly.