• Login
Community
  • Login

remove part of line

Scheduled Pinned Locked Moved General Discussion
5 Posts 3 Posters 414 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.
  • C
    cisco779k
    last edited by Nov 30, 2020, 2:01 PM

    i have

    "trim:track:47EiUVwUp4C9fGccaPuUCS","text001",
    "trim:track:59qrUpoplZxbIZxk6X0Bm3","text002",
    "trim:track:70rFIfYN7lU6iTgUIVP42w","text003",
    

    and i want delete first part of each line “trim…”,

    "text001",
    "text002",
    "text003",
    

    how to?

    1 Reply Last reply Reply Quote 0
    • C
      cisco779k
      last edited by cisco779k Nov 30, 2020, 2:19 PM Nov 30, 2020, 2:17 PM

      or better, how to remove part of txt with recursive text but different value? example:

      "trim:track:47EiUVwUp4C9fGccaPuUCS"
      "trim:track:59qrUpoplZxbIZxk6X0Bm3"
      "trim:track:70rFIfYN7lU6iTgUIVP42w"
      

      this is in case, unlike the previous post, the text to be deleted is not at the beginning of the line, but after other text, always on the same line, example:

      "some text","adc:artist:1bqxdqvUtPWZri43cKHac8, ddd:artist:41X1TR6hrK8Q2ZCpp2EqCz","text2","trim:track:70rFIfYN7lU6iTgUIVP42w",
      
      A 1 Reply Last reply Nov 30, 2020, 2:32 PM Reply Quote 0
      • A
        astrosofista @cisco779k
        last edited by Nov 30, 2020, 2:32 PM

        Hi @cisco779k

        This regex may work in the examples you provided:

        Search: (?-s)"trim:.+?",
        Replace: [Leave empty]
        

        Please don’t forget to take a look to the regex FAQ I suggested you before. Thank you

        Have fun!

        1 Reply Last reply Reply Quote 2
        • C
          cisco779k
          last edited by Nov 30, 2020, 4:14 PM

          many tanxs for your reply!

          A 1 Reply Last reply Nov 30, 2020, 4:19 PM Reply Quote 1
          • A
            Alan Kilborn @cisco779k
            last edited by Nov 30, 2020, 4:19 PM

            @cisco779k

            You have asked several regex data transformation questions on the forum. Give us all some “tanxs” by putting in the effort to learn why @astrosofista 's technique worked on your data, so that in the future you can maybe solve this type of problem (a fairly simple one) without coming here for help.

            Some nice resources are found HERE.

            1 Reply Last reply Reply Quote 2
            • T Terry R referenced this topic on Mar 7, 2023, 6:51 PM
            1 out of 5
            • First post
              1/5
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors