Community
    • Login

    How to delete the last 14 characters from a string

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 548 Views 1 Watching
    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.
    • Red Sox CenturyR Offline
      Red Sox Century
      last edited by

      Dear Community -

      First let me say thank you for reading and any assistance would be most appreciated. I’m not a very tech saavy person and I’m getting older by the day (and I’m already a senior citizen).

      I am trying to replace every character after the semi-colon (;) in every string(?) of text in a list of parts. I have tried using Find and Replace and I have also searched for an answer but I just can’t grasp concept. Per the instructions on FAQ Desk - here is what I am trying to do:

      Delete all characters after the semi-colon in each row
      DRUM-00000001;DRUM-00000001
      DRUM-00000003;DRUM-00000003
      DRUM-00000004;DRUM-00000004
      DRUM-00000005;DRUM-00000005
      DRUM-00000008;DRUM-00000008
      DRUM-00000011;DRUM-00000011
      DRUM-00000014;DRUM-00000014

      Desired outcome would look like this:
      DRUM-00000001;
      DRUM-00000003;
      DRUM-00000004;
      DRUM-00000005;
      DRUM-00000008;
      DRUM-00000011;
      DRUM-00000014;

      Again, thank you very for reading.

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA Offline
        Alan Kilborn @Red Sox Century
        last edited by

        You asked to do TWO different things:

        How to delete the last 14 characters from a string

        Find: (?-s).{14}$
        Replace: nothing
        Search mode: Regular expression

        Delete all characters after the semi-colon in each row:

        Find: (?-s);.*
        Replace: ;
        Search mode: Regular expression

        Red Sox CenturyR 1 Reply Last reply Reply Quote 3
        • Red Sox CenturyR Offline
          Red Sox Century @Alan Kilborn
          last edited by

          @alan-kilborn said in How to delete the last 14 characters from a string:

          (?-s).{14}$

          Dear Mr. Kilborn -

          My word. Thank you so much for not only pointing out that I was asking about two different things but also for solving my issue. I’m so grateful. I’m going to try and work this out in my head so I understand this even though at my age its hard to concentrate on things like this. But I can still try.

          I hope you have a great day and find joy in helping this old guy work something out that IS way out of his (my) league.

          –Red

          1 Reply Last reply Reply Quote 3

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors