Community
    • Login

    Multiply value

    Scheduled Pinned Locked Moved General Discussion
    2 Posts 2 Posters 739 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.
    • Bertrand TufferyB
      Bertrand Tuffery
      last edited by

      Hello
      On notepad i want to muliply value in all files in folder
      Exampe
      On all file, i have label Size1 = 20,40 and Size2 = 30,60
      And i want to replace with this news value sizes = 40,80 Size2 = 60,120 but in all file.

      Which syntaxt should i set in fonction search and replace

      Thx

      1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones
        last edited by PeterJones

        regular expressions in search-and-replace are powerful, but they don’t have built-in arbitrary math expressions.

        If all you wanted to do was replace all instances of Size1 = 20,40 with Size1 = 40,80, that would be easy. If you just had the two sizes, you could use some alternating expressions in the regex replace to make sure the right source got replaced with the right replacement in all the files. But if you have an arbitrary number of SizeN = XXX,YYY, where N, XXX, and YYY all have many values, then crafting a regexp to do that would be an exercise in futility, because you’d have to provide all possible combinations (and you’d miss one)

        You need a programming language, where you would then have to extract the data from each line of your file, do the math, and write to a new file (or use in-place editing features of your language of choice).

        You could write that code in Notepad++. If you use PythonScript or LuaScript plugins, you could even run that code on files that are open in Notepad++. But it really is not a task specific to Notepad++, and the problem is not something that Notepad++ can solve for you.

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