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

21850Re: [Clip] Remove all lines not containing something

Expand Messages
  • Don
    Jun 30, 2011
    • 0 Attachment
      On 6/30/2011 7:49 AM, diodeom wrote:
      > I wrote:
      >>
      >> I have to admit that I didn't consider the condition where the "keeper" terms are always at the line's end -- despite the provided sample data. Your look-behind is a beautifully simple solution for this case.
      >>
      >
      > Sorry, Flo -- I quoted the wrong fragment. Here's your pattern I'm referring to, placed in a swap statement:
      >
      > ^!Replace "^.+$(?<!org|net)(\R|\Z)" >> "" WARS

      To be clearer ;-)

      I only provided a sample, it might be much different and I don't know
      the data going in -- so I literally only know what I want, not what I
      don't want. There are hundreds of lines if not thousands sometimes
      where I use this. Often it is for race results of running races where I
      want to extract a particular team. So we cannot count on \R immediately
      after the search term. I assume \Z is file end? Have to look that one
      up. So it may appear ANYWHERE IN THE LINE, not only at the end.

      I misplaced Flo's email before I responded to it. I'll dig it out again
      later as it did have a lot of good stuff in it.
    • Show all 30 messages in this topic