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

Removing Capped Words From List

Expand Messages
  • gunnisonbirder
    Spent several hours, but this is beyond me. I have a list of words where some of the words are in all caps. Is it possible to write a clip that removes words
    Message 1 of 8 , May 10, 2008
    • 0 Attachment
      Spent several hours, but this is beyond me. I have a list of words
      where some of the words are in all caps. Is it possible to write a
      clip that removes words in all caps and leaves all other words that
      are just proper names? Thanks for any suggestions.

      CAPS 1
      Word 1
      Word 2
      Word 3
      CAPS 2
      Word 1
      Word 4
      Word 5
      CAPS 3
      Word 3

      result
      Word 1
      Word 2
      Word 3
      Word 1
      Word 4
      Word 5
      Word 3
    • loro
      ... You could use ^$IsUppercase()$. _____[ From Help ]_____ ^$IsUppercase( Str )$ (added in v4.8) Returns 1 if Str does not contain any lowercase characters,
      Message 2 of 8 , May 10, 2008
      • 0 Attachment
        gunnisonbirder wrote:
        >Spent several hours, but this is beyond me. I have a list of words
        >where some of the words are in all caps. Is it possible to write a
        >clip that removes words in all caps and leaves all other words that
        >are just proper names? Thanks for any suggestions.
        >
        >CAPS 1
        >Word 1
        >Word 2

        You could use ^$IsUppercase()$.

        _____[ From Help ]_____
        ^$IsUppercase("Str")$ (added in v4.8)
        Returns 1 if Str does not contain any lowercase characters, and 0 if it does.
        ___________________

        Lotta
      • hsavage
        ... gunnison, A quicker, easier way might be to select the list, do a Modify/Text Case/Capitalize, or, if you NoteTab control keys are same as mine do
        Message 3 of 8 , May 10, 2008
        • 0 Attachment
          gunnisonbirder wrote:
          > Spent several hours, but this is beyond me. I have a list of words
          > where some of the words are in all caps. Is it possible to write a
          > clip that removes words in all caps and leaves all other words that
          > are just proper names? Thanks for any suggestions.
          >
          > CAPS 1
          > Word 1
          > Word 2
          > Word 3
          > CAPS 2
          > Word 1
          > Word 4
          > Word 5
          > CAPS 3
          > Word 3

          gunnison,

          A quicker, easier way might be to select the list, do a Modify/Text
          Case/Capitalize, or, if you NoteTab control keys are same as mine do
          Shift+Ctrl+K.

          CAPS 1
          Word 1
          Word 2
          Word 3
          CAPS 2
          Word 1
          Word 4
          Word 5
          CAPS 3
          Word 3

          Either of which will capitalize each word as below.

          Caps 1
          Word 1
          Word 2
          Word 3
          Caps 2
          Word 1
          Word 4
          Word 5
          Caps 3
          Word 3

          Then do a Modify/Lines/Sort/Ascending, or, Shift+Ctrl+X, which will sort
          the list alphabetically and should remove duplicates so you are left
          with the list below.

          Caps 1
          Caps 2
          Caps 3
          Word 1
          Word 2
          Word 3
          Word 4
          Word 5

          Should be easy to delete any words you don't want in the list afterward.

          ·············································
          ºvº SL_131 created_2008.05.10_08.35.43

          Newspaper HeadLine...
          • Drunk Gets Nine Months in Violin Case
          € hrs € hsavage € pobox € com
        • Don Daugherty
          ... This should be easy using Regular Expressions (RegExp) with the Clip command ^!Replace. First I will assume that the integers in your example are NOT
          Message 4 of 8 , May 10, 2008
          • 0 Attachment
            gunnisonbirder wrote:
            > Spent several hours, but this is beyond me. I have a list of words
            > where some of the words are in all caps. Is it possible to write a
            > clip that removes words in all caps and leaves all other words that
            > are just proper names? Thanks for any suggestions.
            >
            > CAPS 1
            > Word 1
            > Word 2
            > Word 3
            > CAPS 2
            > Word 1
            > Word 4
            > Word 5
            > CAPS 3
            > Word 3
            >
            > result
            > Word 1
            > Word 2
            > Word 3
            > Word 1
            > Word 4
            > Word 5
            > Word 3

            This should be easy using "Regular Expressions (RegExp)" with the Clip
            command ^!Replace.

            First I will assume that the integers in your example are NOT part of
            the real situation. If they are, it's easy to modify the solution to
            handle that case.

            The solution is to create a Clip containing the following command:
            ^!Replace "^[A-Z]+\r\n" >> "" RWAS

            If you're not familiar with RegExp here's the translation:
            The '^' means 'starting at the beginning of the line;
            '[A-Z]' means any capital letter;
            '+' means one or more of the thing just matched ([A-Z]);
            '\r\n\ means the end of line characters ('Carriage Return & Line Feed;
            ' >> ' separates the "find-string" from the "replace-by string";
            '""' is the "replace-by string", an empty string in this case;
            R means "interpret the find-string as a Regular Expression'
            W means look in the Whole file regardless of where you start;
            A means do All of them;
            S means be Silent (don't tell me how many you did even if it was zero.

            Notice that the find-string does not allow any spaces between the
            capitalized word and the end of line.
            If there might be some, the construction '[[{blank:]]*' needs to be
            inserted just ahead of '\r\n' ('*' means one-or-more).

            If the integers were part of the "words" then the command should be
            changed to read
            ^!Replace "^[A-Z]+ \d+\r\n" >> "" RWAS
            ' \d+\' means one space followed by one or more digits.
            As before, '[[{blank:]]*' can be inserted just ahead of '\r\n' to
            account for trailing blanks.

            Hope this helps.
          • loro
            ... Something like this should work ... h= Remove UPPERCASE Words ^!Jump text_start ... ^!If ^$IsUppercase( ^$GetLine$ )$ = 1 next else skip_1 ^!DeleteLine
            Message 5 of 8 , May 10, 2008
            • 0 Attachment
              I wrote:
              >You could use ^$IsUppercase()$.

              Something like this should work

              -------------------------
              h="Remove UPPERCASE Words"
              ^!Jump text_start
              :loop
              ^!If ^$IsUppercase("^$GetLine$")$ = 1 next else skip_1
              ^!DeleteLine
              ^!If ^$GetRow$ = ^$GetLineCount$ end
              ^!Jump +1
              ^!Goto loop
              -------------------------

              Lotta
            • Don - HtmlFixIt.com
              ... He doesn t want to delete it, he wants to replace it with no caps. Isn t it more like this? ^!Replace ^([A-Z]+) r n $1 r n RWAS Or am I off?
              Message 6 of 8 , May 10, 2008
              • 0 Attachment
                > The solution is to create a Clip containing the following command:
                > ^!Replace "^[A-Z]+\r\n" >> "" RWAS
                He doesn't want to delete it, he wants to replace it with no caps.
                Isn't it more like this?

                ^!Replace "^([A-Z]+)\r\n" >> "$1\r\n" RWAS

                Or am I off?
              • gunnisonbirder
                ... Thanks for all the help! The following worked great. I was removing about 2000 entries one at a time and quit after about 100. It would have taken
                Message 7 of 8 , May 10, 2008
                • 0 Attachment
                  --- In ntb-clips@yahoogroups.com, "Don - HtmlFixIt.com" <don@...> wrote:
                  >
                  > > The solution is to create a Clip containing the following command:
                  > > ^!Replace "^[A-Z]+\r\n" >> "" RWAS
                  > He doesn't want to delete it, he wants to replace it with no caps.
                  > Isn't it more like this?
                  >
                  > ^!Replace "^([A-Z]+)\r\n" >> "$1\r\n" RWAS
                  >
                  > Or am I off?

                  Thanks for all the help! The following worked great. I was removing
                  about 2000 entries one at a time and quit after about 100. It would
                  have taken forever. Notetab and you guys are super!!

                  Removing caps

                  h="Remove UPPERCASE Words"
                  ^!Jump text_start
                  :loop
                  ^!If ^$IsUppercase("^$GetLine$")$ = 1 next else skip_1
                  ^!DeleteLine
                  ^!If ^$GetRow$ = ^$GetLineCount$ end
                  ^!Jump +1
                  ^!Goto loop

                  >
                • loro
                  ... You are welcome. Glad it worked. If the document is that large, you may want to add this line at the top of the clip though. Faster and less flicker.
                  Message 8 of 8 , May 10, 2008
                  • 0 Attachment
                    gunnisonbirder wrote:
                    >Thanks for all the help! The following worked great. I was removing
                    >about 2000 entries

                    You are welcome. Glad it worked. If the document is that large, you
                    may want to add this line at the top of the clip though. Faster and
                    less flicker.

                    ^!SetScreenUpdate off

                    Lotta
                  Your message has been successfully submitted and would be delivered to recipients shortly.