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