|
@@ -22,7 +22,6 @@ gi: {[r;c;rb;cb]
|
|
|
};
|
|
|
|
|
|
// decode excel formula
|
|
|
-// fill these ==========
|
|
|
mc: {[c;i]
|
|
|
i: gi[(#table);i+1;0;c];
|
|
|
:i
|
|
@@ -32,7 +31,6 @@ mr: {[r;i]
|
|
|
i: gi[i+1;(#table[0]);r;0];
|
|
|
:i
|
|
|
};
|
|
|
-// =====================
|
|
|
|
|
|
drr: {[s;e]
|
|
|
r: $[s[0]<0;mc[s[1];(e[1]-s[1])];mr[s[0];(e[0]-s[0])]];
|
|
@@ -75,17 +73,22 @@ de:{[idx;cell]
|
|
|
ci: cell[0];
|
|
|
cell: cell[1];
|
|
|
idx: (*idx);
|
|
|
- f: slice[cell;idx[0];idx[1]];
|
|
|
|
|
|
+ f: slice[cell;idx[0];idx[1]];
|
|
|
l: slice[cell;0;idx[0]];
|
|
|
r: slice[cell;idx[1];#cell];
|
|
|
+ u.ppr (l;r);
|
|
|
+ u.ppr table[ci[0];ci[1]];
|
|
|
|
|
|
(fl;fr): lr[f];
|
|
|
- deps[ci[0];ci[1]]:: (1;1);
|
|
|
+ r: dr[fl;fr];
|
|
|
|
|
|
- u.ppr "de: ", f;
|
|
|
- u.ppr (fl;fr);
|
|
|
- u.ppr'deps;
|
|
|
+ i: (ci[0]*3) + ci[1];
|
|
|
+ {
|
|
|
+ i:(*y);
|
|
|
+ i: (i[0]*3)+i[1];
|
|
|
+ deps[x;i]: 1;
|
|
|
+ }[(ci[0]*3)+ci[1];]'r;
|
|
|
};
|
|
|
|
|
|
/:parseidx["[1;2]"];
|
|
@@ -98,24 +101,32 @@ sectionkeys: (tstkey;cstkey;astkey);
|
|
|
|
|
|
lines: {x,"\n",y}/(0: "SS.csv");
|
|
|
table:: csv.csv[lines];
|
|
|
-deps:: (#table;#table[0])#0;
|
|
|
+d: (#table)*(#table[0]);
|
|
|
+deps:: (d;d)#0;
|
|
|
|
|
|
/ excel patterns
|
|
|
-pats: pat.run''table;
|
|
|
+:pats: pat.run''table;
|
|
|
|
|
|
u.ppr'table;
|
|
|
/ u.ppr'pats;
|
|
|
|
|
|
// start with last to maintain prior index accuracy
|
|
|
lasts:{:((#x[0])-1)_x[0]}''pats;
|
|
|
+firsts:{:$[(#x[0])>1;((#x[0])-1)#x[0];0]}''pats;
|
|
|
|
|
|
f: pats {
|
|
|
:$[x[2]=5;y;0]
|
|
|
}''lasts;
|
|
|
|
|
|
ti: gi[#table;#table[0];0;0];
|
|
|
-table :ti {(,x),,y}''table;
|
|
|
+table::ti {(,x),,y}''table;
|
|
|
|
|
|
-/ table {
|
|
|
-/ :$[y~0;0;de[y;x]]
|
|
|
-/ }''f
|
|
|
+table {
|
|
|
+ :$[y~0;0;de[y;x]]
|
|
|
+}''f;
|
|
|
+
|
|
|
+table {
|
|
|
+ :$[y~0;0;de[y;x]]
|
|
|
+}''firsts;
|
|
|
+
|
|
|
+:deps
|