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

Re: [NTB] Remove lines with keywords?

Expand Messages
  • Jody
    Hi Palladin, ... You need a Clip to do what you want. I m copying the Clips list where you need to sign up for and continue with this on that list. Please see
    Message 1 of 2 , Aug 2 7:38 AM
    • 0 Attachment
      Hi Palladin,

      >This is my first post. I hope it's acceptable. My question
      >involves whether NoteTab has the ability to remove lines from a
      >text file that contain a certain keyword, or string.

      You need a Clip to do what you want. I'm copying the Clips list
      where you need to sign up for and continue with this on that
      list. Please see my signature line to subscribe to it. TIA You
      might want to post right away and mention that the word "bad"
      given in your example can be anywhere in the domain, not just
      starting with it. So, both the following lines would be deleted.
      If it needs to be when they only start with "theSearch.String.us"
      let us know.

      127.0.0.1 badboss.tv
      127.0.0.1 bossbad.tv

      >Anyway, here is a brief sample of what my Hosts file looks like:
      >
      >127.0.0.1 backupdvd.info
      >127.0.0.1 backwebtechnologies.rsc01.net
      >127.0.0.1 bad-credits.net
      >127.0.0.1 bad.a6.squally7845tabs.us
      >127.0.0.1 badboss.tv
      >127.0.0.1 badcredithistorycreditcard.com
      >127.0.0.1 baden24.ivwbox.de
      >127.0.0.1 badlands.112.2o7.net
      >
      >There's thousands of these "hosts", or websites, in my Hosts
      >file. What I need NoteTab to do is remove all host entries that
      >contain a certain word, or "string" that I specify, because I
      >have another filter method based on keywords, and I want to slim
      >my huge Hosts file down, for speed of access purposes. So far I
      >have not been able to figure out how to do it with my NoteTab,
      >but I feel N.T. can do it. For instance, if I specify that
      >NoteTab remove all entries that contain the word "bad" from the
      >list above, NoteTab would delete or separate from the list 6 of
      >the 8 hosts, starting at- 127.0.0.1 bad-credits.net.
      >There will be around 200 of these keywords I will use to pare
      >down my very large Hosts file. If I could specify all 200 strings
      >in the same operation, that would be even better, but I'll settle
      >for one at a time. Is any of this possible with NoteTab? And if
      >so, how? Thanks, Billy


      Happy Clip'n!
      Jody

      www.clean-funnies.com, http://www.fookes.us/maillist.htm

      Subscribe: mailto:ntb-Clips-Subscribe@yahoogroups.com
      UnSubscribe: mailto:ntb-Clips-UnSubscribe@yahoogroups.com
      Options: http://groups.yahoo.com/group/ntb-clips
    • Jody
      Hi Billy, The H=Clipname line is long; remove hard line breaks if there are any - you can use Modify | Lines | Join Lines after selecting the line. See note
      Message 2 of 2 , Aug 2 9:12 AM
      • 0 Attachment
        Hi Billy,

        The H=Clipname line is long; remove hard line breaks if there are
        any - you can use Modify | Lines | Join Lines after selecting the
        line. See note about adding your list of strings to search for
        inside Clip (%StringList%). If the Clip gets too messed up for
        you to fix or you don't understand how to add it, download the
        nnnLines Library from below. To edit a Clip right click over it
        and choose Edit Clip...

        <--- Copy below this line --->
        H=DeleteLine if it contains... Deletes all lines in document if they contain the string you specify.
        ; Clip is also in: http://www.notetab.net/zip/nnnlines.zip
        ; eMailed on 08-02-2004, ntb-clips@yahoogroups.com, Jody
        ; notetab.net, clean-funnies.com, fookes.us, sojourner.us
        ; Fookes Software Home
        ; http://www.fookes.com/regnow.html?2448&item=home

        ^!SetHintInfo Removing domains...
        ^!SetScreenUpdate Off
        ^!ClearVariable %DeleteList%

        ; *******************************************
        ; Insert list of comma separated words after
        ; SetArray %StringList%= (Remove bad,tech)
        ; *******************************************

        ^!SetListDelimiter ,
        ^!SetArray %StringList%=bad,tech
        ^!Set %Count%=^%StringList0%
        ^!Set %Index%=0; %DeleteCount%=0

        :Loop1
        ^!Jump 1
        ^!Inc %Index%
        ^!If ^%Index% > ^%Count% Stats

        :Loop2
        ^!Find "^%StringList^%Index%%" SITC
        ^!IfError Loop1
        ^!Select Line
        ^!Set %LineDeleted%=^$GetSelection$
        ; ^!DeleteLine
        ^!Toolbar Clear All
        ^!Inc %DeleteCount%
        ^!Append %DeleteList%=^%LineDeleted%
        ^!Goto Loop2

        :Stats
        ^!Jump 1
        ; long line follows, remove any hard line breaks if any - Join Lines ;)
        ^!SetWizardTitle Get more Libraries & Clips at the NoteTabbers Assistant Page: http://www.notetab.net
        ^!Info [L]Number of lines deleted: ^%DeleteCount%^p^p^%DeleteList%

        <--- Copy above this line --->
        <--- Right click over a Library --->
        <--- Choose: Add from Clipboard --->

        >This is my first post. I hope it's acceptable. My question
        >involves whether NoteTab has the ability to remove lines from a
        >text file that contain a certain keyword, or string.

        >Anyway, here is a brief sample of what my Hosts file looks like:
        >
        > 127.0.0.1 backupdvd.info
        > 127.0.0.1 backwebtechnologies.rsc01.net
        > 127.0.0.1 bad-credits.net
        > 127.0.0.1 bad.a6.squally7845tabs.us
        > 127.0.0.1 badboss.tv
        > 127.0.0.1 badcredithistorycreditcard.com
        > 127.0.0.1 baden24.ivwbox.de
        > 127.0.0.1 badlands.112.2o7.net
        >
        > There's thousands of these "hosts", or websites, in my Hosts
        > file. What I need NoteTab to do is remove all host entries that
        > contain a certain word, or "string" that I specify, because I
        > have another filter method based on keywords, and I want to
        > slim my huge Hosts file down, for speed of access purposes. So
        > far I have not been able to figure out how to do it with my
        > NoteTab, but I feel N.T. can do it. For instance, if I specify
        > that NoteTab remove all entries that contain the word "bad"
        > from the list above, NoteTab would delete or separate from the
        > list 6 of the 8 hosts, starting at- 127.0.0.1 bad-credits.net.
        > There will be around 200 of these keywords I will use to pare
        > down my very large Hosts file. If I could specify all 200
        > strings in the same operation, that would be even better, but
        > I'll settle for one at a time. Is any of this possible with
        > NoteTab? And if so, how? Thanks, Billy

        Happy Clip'n!
        Jody

        www.clean-funnies.com, http://www.fookes.us/maillist.htm

        Subscribe: mailto:ntb-Clips-Subscribe@yahoogroups.com
        UnSubscribe: mailto:ntb-Clips-UnSubscribe@yahoogroups.com
        Options: http://groups.yahoo.com/group/ntb-clips
      Your message has been successfully submitted and would be delivered to recipients shortly.