I exported a large excel spreadsheet as html and I want to calculate some cells' values in JavaScript. I smuggled the expressions used in excel as data-xxx info in every P I intend to fill.
Is there a way of translating the data-xxx to JavaScript code so that it'll give me the wanted value?
Example strings:
06A02
min(06C02;06C03)
max(03B04;03B05;03B06)
max(min(07A01;07A02;08F01);min(09A01;09A02))
max(min(03B01;03B02;03B03);08C02;09B01;09C02)
max(min(07A03;07A04;08F02);min(09A03;09A04);09C02)
max(09B05;min(07A01;07A02;08F01);min(09A01;09A02))
max(09B05;min(07A03;07A04;08F02);min(09A03;09A04);09B01;09C02)
06A02 and similar are just keys of values stored in localStorage, saved via another page's form.
I thought I could just use ifs and elses and slice the string piece by piece, but that would make a giant tree I could make too many mistakes in.
I thought of regular expressions to shorten the tree, but I'm not sure if it's that much better.
There may be a way I don't know yet.
Example HTML:
<TR>
<TD>Prolonged lack of access...</TD>
<TD>A</TD>
<TD>A</TD>
<TD><p id="ar1_11e" data-eks="AC.E.Inc"></p></TD>
<TD>1</TD>
<TD><p id="ar1_11za" data-zap="03D01"></p></TD>
<TD><p id="ar1_11i" data-imp="ar1"></p></TD>
<TD><p id="ar1_11og" data-ogr="min(03D02;03D03)"></p></TD>
<TD><p id="ar1_11la" data-lag="04A05"></p></TD>
<TD><p id="Par1_11"></p></TD>
<TD><p id="War1_11"></p></TD>
<TD><p id="Rar1_11"></p></TD>
<TD><p id="Oar1_11"></p></TD>
</TR>