• Login
Community
  • Login

Possibility to calculate numbers?

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
7 Posts 5 Posters 24.6k 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.
  • J
    Jürgen Greil
    last edited by Jürgen Greil Oct 1, 2017, 8:58 AM Oct 1, 2017, 8:56 AM

    Hello,

    I have a file which cointains only 1 number in each line, like this:

    5,30
    6,90
    7,50
    12,8
    1,11
    0,50

    Is there any function or script in Notepad++ to get the sum (34,11) of all this lines?
    This would be very helpful. I know, that it is easy to copy it and paste it in Excel and see the sum immediately, but for me it would be very helpful to see it directly in Notepad++.
    Do you have any idea how to get this?
    If necessary I could of course change the decimal sign from , to . before calculating the sum.

    C 1 Reply Last reply Oct 2, 2017, 1:50 PM Reply Quote 0
    • C
      Claudia Frank @Jürgen Greil
      last edited by Oct 2, 2017, 1:50 PM

      @Jürgen-Greil

      nothing builtin - but there is a math plugin available, check plugin manager.
      Maybe it can do what you want or install a scripting language plugin like python or lua script
      and write a script doing it.

      Cheers
      Claudia

      1 Reply Last reply Reply Quote 0
      • G
        Gogo Neatza
        last edited by Oct 24, 2017, 3:53 AM

        One other way is to use TextFX.
        My version of Notepad++ has under TextFx Tools an “Add up numbers” option.

        For the block:
        5.30
        6.90
        7.50
        12.8
        1.11
        0.501
        TextFX prints the message “Sum=34.1110”

        G 1 Reply Last reply Sep 29, 2021, 3:10 PM Reply Quote 1
        • G
          georg-d @Gogo Neatza
          last edited by georg-d Sep 29, 2021, 3:11 PM Sep 29, 2021, 3:10 PM

          Does anyone know how to get TextFX Tools’s feature “Add up numbers” in a current version of Notepad++?
          https://stackoverflow.com/questions/55197040/add-a-value-and-sum-it-up-using-notepad is quite complicated.

          G P 2 Replies Last reply Sep 29, 2021, 3:22 PM Reply Quote 0
          • G
            georg-d @georg-d
            last edited by Sep 29, 2021, 3:22 PM

            As a quite feasible workaround, I mark columns in Notepad++ via ALT+DragAndDrop and then copy & paste numbers to https://planetcalc.com/8183/ respectively times to https://rechneronline.de/add-time/multi.php for summing them up. MS Excel / LibreOffice Calc are worse as they contain many pitfalls when exceeding 24 hours.

            Still, I’d prefer to have the feature of the TextFX plugin as it is more convenient and I do not send the numbers into the Internet.

            1 Reply Last reply Reply Quote 0
            • P
              PeterJones @georg-d
              last edited by Sep 29, 2021, 3:29 PM

              @georg-d ,

              Actually, the process you linked to in SO is quite simple, and is the best solution: 1) install plugin, 2) copy/paste/save from the SO answer, 3) run the script from the menu. This is only slightly more complicated than 1) Install TextFX, 2) run the summation from the menu.

              Further, you are not accurate about TextFX not working with modern Notepad++: it still works for the purpose you just described, even as late as v8.1.5 (the most recent release as of Sep 2021) – you just have to use the 32bit Notepad++, use Plugins Admin to install TextFX; et voila, you have the 2014 method of summing numbers again.

              P 1 Reply Last reply Sep 29, 2021, 3:32 PM Reply Quote 1
              • P
                PeterJones @PeterJones
                last edited by PeterJones Sep 29, 2021, 3:33 PM Sep 29, 2021, 3:32 PM

                Sorry, I forgot my screenshot and debug info, which I meant to include above as evidence of my claim:

                7b483fc1-9ba8-4a7e-a417-15937bccd915-image.png

                Notepad++ v8.1.5   (32-bit)
                Build time : Sep 26 2021 - 15:15:32
                Path : C:\usr\local\apps\npp\npp.8.1.5.portable\notepad++.exe
                Command Line : 
                Admin mode : OFF
                Local Conf mode : ON
                Cloud Config : OFF
                OS Name : Windows 10 Enterprise (64-bit) 
                OS Version : 2009
                OS Build : 19042.1237
                Current ANSI codepage : 1252
                Plugins : mimeTools.dll NppConverter.dll NppExport.dll NppTextFX.dll 
                
                1 Reply Last reply Reply Quote 1
                • First post
                  Last post
                The Community of users of the Notepad++ text editor.
                Powered by NodeBB | Contributors