Community

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

    Append the values to a text

    Help wanted · · · – – – · · ·
    regex notepad++ regex prefix string compare strings
    2
    3
    79
    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 Chavan
      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
      • Ekopalypse
        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 Chavan 1 Reply Last reply Reply Quote 3
        • Nikhil Chavan
          Nikhil Chavan @Ekopalypse last edited by

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

          1 Reply Last reply Reply Quote 1
          • First post
            Last post
          Copyright © 2014 NodeBB Forums | Contributors