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

keeping lines in a file that has a specific string

Expand Messages
  • asj7773
    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
    Message 1 of 3 , Dec 14, 2006
    • 0 Attachment
      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
    • 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 2 of 3 , 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
        --
      • andrew james
        Thanks Alec. I placed a response to the thread below but no answer. I am not clear where to write the expression you emailed. I am new to clips. Alec
        Message 3 of 3 , Dec 15, 2006
        • 0 Attachment
          Thanks Alec. I placed a response to the thread below but no answer. I am not clear where to write the expression you emailed. I am new to clips.

          Alec Burgess <buralex@...> wrote: 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
          --





          __________________________________________________
          Do You Yahoo!?
          Tired of spam? Yahoo! Mail has the best spam protection around
          http://mail.yahoo.com

          [Non-text portions of this message have been removed]
        Your message has been successfully submitted and would be delivered to recipients shortly.