RosettaCodeData/Task/CSV-data-manipulation/Logo/csv-data-manipulation-1.logo
2024-04-19 16:56:29 -07:00

19 lines
394 B
Text

to csv.data.manipulation :in :out
local [header line list sum]
openread :in
setread :in
openwrite :out
setwrite :out
make "header readword
print word :header ",SUM
while [not eofp] [
make "line readword
make "list parse map [ifelse equalp ? ", ["\ ] [?]] :line
make "sum apply "sum :list
print (word :line "\, :sum)
]
close :in
setread []
close :out
setwrite []
end