Data update

This commit is contained in:
Ingy döt Net 2024-07-13 15:19:22 -07:00
parent 29a5eea0d4
commit 5c1bb7bfa9
2011 changed files with 35081 additions and 3229 deletions

View file

@ -0,0 +1,9 @@
begin
var lines := ReadLines('data.csv').Select((line,i) -> begin
if i = 0 then
Result := line + ',SUM'
else Result := line + ',' + line.Split(',').Sum(x -> x.ToInteger);
end);
WriteLines('outdata.csv',lines);
lines.PrintLines;
end.

View file

@ -0,0 +1,11 @@
# Simple CSV manipulation
# Effect of running `&fras "example.csv"`
$ C1,C2,C3,C4,C5
$ 1,5,9,13,17
$ 2,6,10,14,18
$ 3,7,11,15,19
$ 4,8,12,16,20
&p⍜°csv(⍜⍉⊂:⊂□"SUM"≡(□⍜⋕/+)↘1.)
# Save using `&fwa "example.csv"`