You are here: PSPad forum > English discussion forum > Expert: simultaneous mathematical calculations

Expert: simultaneous mathematical calculations

Goto Page: 1 2 Next

#1 Expert: simultaneous mathematical calculations

Posted by: maki | Date: 2020-04-10 10:31 | IP: IP Logged

I need help.
Could someone write me a simple script or mini application for simultaneous mathematical calculations?

Each last number is automatically added and divided by the same number to two decimal places.

Exaple:

Import text:
09+75+54+65+38+64+69+74+12+51+18+49+23+05+32+35+37+07+53+67
05+32+24+18+10+43+15+56+80+34+23+65+25+17+48+78+72+33+50+71
40+76+29+16+14+31+30+51+52+12+64+54+62+10+35+36+43+08+46+09


Replace with and calculate:

09+75+54+65+38+64+69+74+12+51+18+49+23+05+32+35+37+07+53+67 : 67 =
05+32+24+18+10+43+15+56+80+34+23+65+25+17+48+78+72+33+50+71 : 71 =
40+76+29+16+14+31+30+51+52+12+64+54+62+10+35+36+43+08+46+09 : 09 =

Options: Reply | Quote | Up ^


#2 Re: Expert: simultaneous mathematical calculations

Posted by: maki | Date: 2020-04-14 12:35 | IP: IP Logged

I can do it in a Browser Javascript Console, but how do I split it into individual lines in PSPad?

Add:
[2, 2.8125, 2.975]

Replace Multiline result
2
2.8125
2.975

Options: Reply | Quote | Up ^


#3 Re: Expert: simultaneous mathematical calculations

Posted by: maki | Date: 2020-04-14 13:38 | IP: IP Logged

[

].join('\n'),

Options: Reply | Quote | Up ^


#4 Re: Expert: simultaneous mathematical calculations

Posted by: maki | Date: 2020-04-14 14:09 | IP: IP Logged

Too much data:

"Uncaught SyntaxError: Unexpected end of input"

Options: Reply | Quote | Up ^


#5 Re: Expert: simultaneous mathematical calculations

Posted by: Vany | Date: 2020-04-17 15:35 | IP: IP Logged

hi, wouldn't you even try some spreadsheet calculator (LibreOffice, MS Excel, etc.)?

--
Vany
(PSPad 5.0.4 (395) x32, W10h/p x64 en/cs)

Options: Reply | Quote | Up ^


#6 Re: Ekspert: jednoczesne obliczenia matematyczne

Posted by: maki | Date: 2020-04-19 07:44 | IP: IP Logged

I've never used it and I don't know how to use it.

Options: Reply | Quote | Up ^


#7 Re: Ekspert: jednoczesne obliczenia matematyczne

Posted by: pspad | Date: 2020-04-19 07:49 | IP: IP Logged

Time to learn something new.

Options: Reply | Quote | Up ^


#8 Re: Ekspert: jednoczesne obliczeniae

Posted by: maki | Date: 2020-04-22 15:40 | IP: IP Logged

I know how to fully support CSV, but how to get summary results?
Why use overrated and too slow software like MS Excel (NOT FREEWARE) and Libre, if there are even more powerful and faster tools for super-large databases?
Here you need a too complicated replace expression decimal, or what program that will know that e.g.
11.43 = 11
and 12.53 = 13
12.5 = 12 and 13

Bad expression for range 1 to 80 (integer only)
(?:-?[1-9]\d*$)|(?:^0)

Ignore
Example:
1.123
OR
1,123

Edited 4 time(s). Last edit at 2020-04-22 15:45 by maki.

Options: Reply | Quote | Up ^


#9 Re: Ekspert: jednoczesne obliczeniae

Posted by: pspad | Date: 2020-04-22 16:20 | IP: IP Logged

If you know work with databases, import your CSV into table and use SQL command to replace it with rounded value

Options: Reply | Quote | Up ^


#10 Re: Ekspert: jednoczesne obliczeniae

Posted by: pspad | Date: 2020-04-22 17:00 | IP: IP Logged

PSPad can calculate expression in selection:
Round(11.43)

You can write script and use scripting capabilities (JScript or VBScript) to round up your values line by line or write results into new documents

Options: Reply | Quote | Up ^


Goto Page: 1 2 Next





Editor PSPad - freeware editor, © 2001 - 2020 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR