Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    leave each Nth line, if contains .... (in script)

    Help wanted · · · – – – · · ·
    3
    3
    992
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Gonen Shoham
      Gonen Shoham last edited by

      Hi

      I have a file like this:

      AAAAA
      BBBBB - 11111
      BBBBB - 22222
      BBBBB - 33333
      CCCCC
      BBBBB - 44444
      BBBBB - 55555
      BBBBB - 66666
      BBBBB - 77777
      BBBBB - 88888
      BBBBB - 99999
      BBBBB - 00000
      BBBBB - AAAA

      first request - i would like to work only on the lines that contain BBBBB and leave every 5th line of them
      second request - i would like to delete all lines that contain a specific string

      I need these to run in a script

      many thanks

      Claudia Frank 1 Reply Last reply Reply Quote 0
      • guy038
        guy038 last edited by

        Hello, @gonen-shoham,

        I understood that you’re interested on lines containing the string BBBBB only, and, also, that you would like to delete lines with a specific string. But, as English is not my native language, I’m still wondering about the expression leave every 5th line of them !

        May be, you could show us from your initial text, or other text, what is the exact text that you expect to ?

        Best Regards,

        guy038

        1 Reply Last reply Reply Quote 1
        • Claudia Frank
          Claudia Frank @Gonen Shoham last edited by

          @Gonen-Shoham

          in addition to what Guy already mentioned, it would be good to know what kind of
          scripting language you are thinking of.

          Cheers
          Claudia

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright © 2014 NodeBB Forums | Contributors