Community

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

    remove part of line

    General Discussion
    3
    5
    76
    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.
    • cisco779k
      cisco779k last edited by

      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
      • cisco779k
        cisco779k last edited by cisco779k

        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",
        
        astrosofista 1 Reply Last reply Reply Quote 0
        • astrosofista
          astrosofista @cisco779k last edited by

          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
          • cisco779k
            cisco779k last edited by

            many tanxs for your reply!

            Alan Kilborn 1 Reply Last reply Reply Quote 1
            • Alan Kilborn
              Alan Kilborn @cisco779k last edited by

              @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
              • First post
                Last post
              Copyright © 2014 NodeBB Forums | Contributors