• Login
Community
  • Login

Remove strings every nth space

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
remove a word istringsearch & replace
3 Posts 2 Posters 256 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.
  • J
    JessicaWills837
    last edited by Jun 1, 2022, 3:35 AM

    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

    T 1 Reply Last reply Jun 1, 2022, 3:48 AM Reply Quote 0
    • T
      Terry R @JessicaWills837
      last edited by Terry R Jun 1, 2022, 3:49 AM Jun 1, 2022, 3:48 AM

      @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

      J 1 Reply Last reply Jun 1, 2022, 5:19 AM Reply Quote 1
      • J
        JessicaWills837 @Terry R
        last edited by Jun 1, 2022, 5:19 AM

        @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
        2 out of 3
        • First post
          2/3
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors