Community
    • Login

    Remove strings every nth space

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    remove a word istringsearch & replace
    3 Posts 2 Posters 242 Views
    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.
    • JessicaWills837J
      JessicaWills837
      last edited by

      I’m new to this so sorry if I’m titling this incorrectly. Essentially what I want to do is this:

      06/27/19 Fri 9:00 AM 10:30 AM 1:30 9:00-10:30 AM Overview of optical components
      06/27/19 Fri 12:00 PM 1:00 PM 1:00 12:00-1:00 PM Telescope diagnostics

      Into

      06/27/19 Fri 9:00 AM 10:30 AM Overview of optical components
      06/27/19 Fri 12:00 PM 1:00 PM Telescope diagnostics

      Terry RT 1 Reply Last reply Reply Quote 0
      • Terry RT
        Terry R @JessicaWills837
        last edited by Terry R

        @reggiewills837 said in Remove strings every nth space:

        Essentially what I want to do is this:

        I think you have done a reasonable job of explaining. the test will be if my solution meets your needs. It does work on the 2 lines you provided. If you find it does not work on all the lines then you should read the pinned post in “Help Wanted” titled “Please Read this before Posting” as it explains the need to be accurate and truly representative of the data you have. It also goes on to explain how to present examples so they appear in a black box. This prevents the posting engine from attempting to reformat your post and possibly corrupting data.

        So using the Replace function we have:
        Find What:(?-is)((?:.+?[AP]M){2}).+?[AP]M(.+)
        Replace With:\1\2
        Search mode is regular expression. You can directly copy the red text into the appropriate fields in the Replace function.

        We’d like to know if it works or even if it doesn’t so we can adjust but if posting again please try and insert examples to way the read me says.

        Terry

        JessicaWills837J 1 Reply Last reply Reply Quote 1
        • JessicaWills837J
          JessicaWills837 @Terry R
          last edited by

          @terry-r This was very helpful, and worked perfectly. I was able to use and also modify your solution to remove the ending time aswell. Really cool the stuff you can do with N++

          1 Reply Last reply Reply Quote 1
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors