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

Re: [NTB] keeping lines in a file that has a specific string

Expand Messages
  • Alec Burgess
    Hi Andrew: If you haven t already, join the clips list (link s/b at the bottom of this page) and then refer to this thread: ntb-clips : Message: Pulling lines
    Message 1 of 1 , Dec 15, 2006
    • 0 Attachment
      Hi Andrew:

      If you haven't already, join the clips list (link s/b at the bottom of
      this page)
      and then refer to this thread:
      ntb-clips : Message: Pulling lines of HTML code out of a page
      http://tech.groups.yahoo.com/group/ntb-clips/message/15835

      The OP wanted only lines that had a particular string at the BEGINNING
      of a line.
      To grab lines with a string ANYWHERE in a string, change this line:
      ^!Set %foundStuff%=^$GetDocMatchAll("(?im-s)^(?=(^%what_to_look_for%)(.*)")$
      to
      ^!Set %foundStuff%=^$GetDocMatchAll("(?im-s)^(.*^%what_to_look_for%.*")$

      this incorporates a couple of changes discussed later in the thread.
      Note both lines above s/b on one line. Yahoo-groups will probably split
      them :-(
      Above solution requires Notetab 5.x due to syntax changes from Notetab 4.9x

      I've copied this to the clips list, if more explanation is required,
      please respond there, not to the Notetab (main) list.
      > Hello everyone:
      >
      > I am enjoying the software and finding new uses.
      >
      > If someone can recommend a solution. One of my everyday uses, as I
      > edit files is to keep only lines that has specific strings:
      >
      > for example, I get a file with 3000 lines but I only wants lines that
      > has the string "PAID" and the result should be only the few lines that
      > meet the condition.
      >
      > I do not know how to use awk in this context and its not installed on
      > my laptop with wondows xp.
      >
      > Any feedback is appreciated.
      >
      > Andrew

      Regards ... Alec -- buralex-gmail
      --
    Your message has been successfully submitted and would be delivered to recipients shortly.