Community
    • Login

    Append the values to a text

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    regexregexprefixstring comparestrings
    3 Posts 2 Posters 337 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.
    • Nikhil ChavanN
      Nikhil Chavan
      last edited by

      Hi All,

      Need a Regex formula for below scenario.

      String:
      /Var/opt/oracle/test/myfile.txt

      Output I want using Regex fomula:
      cp -rp /Var/opt/oracle/test/myfile.txt /Var/opt/oracle/test/myfile.txt_${stamp}

      So basically its copying the whole string twice and prefixing it with "cp -rp " and at the end its appending with “_${stamp}”

      Is is possible to implement in Regex? If yes then It would be very helpful.

      Thanks in advance,
      Nikhil Chavan

      1 Reply Last reply Reply Quote 0
      • EkopalypseE
        Ekopalypse
        last edited by

        @Nikhil-Chavan said in Append the values to a text:

        cp -rp /Var/opt/oracle/test/myfile.txt /Var/opt/oracle/test/myfile.txt_${stamp}

        I assume you do have a file with each line being a path to a file,
        if so then
        find what: ^.+$
        replace with: cp -rp $0 $0_${stamp}

        Nikhil ChavanN 1 Reply Last reply Reply Quote 3
        • Nikhil ChavanN
          Nikhil Chavan @Ekopalypse
          last edited by

          @Ekopalypse Superb!! Thanks alot! It worked… :)

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